Click here to Skip to main content
15,891,431 members

Comments by Mydsh (Top 16 by date)

Mydsh 9-Feb-16 1:43am View    
Deleted
Hello Manas, I need your help again, the above xslt works great and now I need to do pagination.display 20 records in each page. I tried and code is as below, my code is not working,please check , am passing the parameters from c# code.
Thanks in advance.

what I tried
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output method="html" indent="yes" omit-xml-declaration="yes">
<xsl:param name="Page">
<xsl:param name="PageSize">
<xsl:param name="PageURL">

<xsl:template match="node()|@*" name="identity">
<xsl:copy>
<xsl:apply-templates select="node()|@*">



<xsl:template name="results" match="/">
<xsl:variable name="mycount" select="count(root/Keyword_Details)">
<xsl:variable name="selectedRowCount" select="floor((number($mycount)-1) div $PageSize)+1">

<!--Start Pagination logic -->

<html>

<style>

.alternative_cls:nth-child(even){
background:#ccc;
}
</style>

<!-- Pagination logic -->
<xsl:for-each select="root/Keyword_Details">
<xsl:if test="position() >= ($Page * $PageSize) + 1">
<xsl:if test="position() <= $PageSize + ($PageSize * $Page)">

<div class="alternative_cls" style="padding-left: 30px; padding-top:1px;padding-bottom:0.5px;width=500px" >




<br/>

<div style= "float:left;font-family: Times New Roman">



<xsl:value-of select="casename">

(<xsl:value-of select="date">)


</div>

<br/>

<div style= "float:left;font-family: Times New Roman">
<xsl:value-of select="docket">
</div>

<br/>

<div style= "float:left;font-family: Times New Roman">
<xsl:value-of select="court">
</div>

<br/>
<br/>
<br/>


</div>




<!--End Pagination logic -->

<!-- Prev link for pagination -->
<xsl:choose>
<xsl:when test="number($Page)-1 >= 0">
 

<xsl:attribute name="href">
<xsl:value-of select="$PageURL">?page=<xsl:value-of select="number($Page)-1">&pagesize=<xsl:value-of select="$PageSize">

<<Prev


<xsl:otherwise>
<!-- display something else -->


<!-- Prev link for pagination -->

<xsl:if test="$selectedRowCount > 1">
 
<xsl:value-of select="number($Page)+1"> of <xsl:value-of select="number($selectedRowCount)">
 

<!-- Next link for pagination -->
<xsl:choose>
<xsl:when test="number($Page)+1 < number($selectedRowCount)">
 

<xsl:attribute name="href">
<xsl:value-of select="$PageURL">?page=<xsl:value-of select="number($Page)+1">&pagesize=<xsl:value-of select="$PageSize">

Next>>





</html>



Mydsh 9-Feb-16 1:29am View    
Deleted
Hello Manas, I need your help again, the above xslt works great and now I need to do pagination.display 20 records in each page. I tried and code is as below, my code is not working,please check , am passing the parameters from c# code
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output method="html" indent="yes" omit-xml-declaration="yes">
<xsl:param name="Page">
<xsl:param name="PageSize">
<xsl:param name="PageURL">

<xsl:template match="node()|@*" name="identity">
<xsl:copy>
<xsl:apply-templates select="node()|@*">



<xsl:template name="results" match="/">
<xsl:variable name="mycount" select="count(root/Keyword_Details)">
<xsl:variable name="selectedRowCount" select="floor((number($mycount)-1) div $PageSize)+1">

<!--Start Pagination logic -->

<html>

<style>

.alternative_cls:nth-child(even){
background:#ccc;
}
</style>

<!-- Pagination logic -->
<xsl:for-each select="root/Keyword_Details">
<xsl:if test="position() >= ($Page * $PageSize) + 1">
<xsl:if test="position() <= $PageSize + ($PageSize * $Page)">

<div class="alternative_cls" style="padding-left: 30px; padding-top:1px;padding-bottom:0.5px;width=500px" >




<br/>

<div style= "float:left;font-family: Times New Roman">



<xsl:value-of select="casename">

(<xsl:value-of select="date">)


</div>

<br/>

<div style= "float:left;font-family: Times New Roman">
<xsl:value-of select="docket">
</div>

<br/>

<div style= "float:left;font-family: Times New Roman">
<xsl:value-of select="court">
</div>

<br/>
<br/>
<br/>


</div>




<!--End Pagination logic -->

<!-- Prev link for pagination -->
<xsl:choose>
<xsl:when test="number($Page)-1 >= 0">
 

<xsl:attribute name="href">
<xsl:value-of select="$PageURL">?page=<xsl:value-of select="number($Page)-1">&pagesize=<xsl:value-of select="$PageSize">

<<Prev


<xsl:otherwise>
<!-- display something else -->


<!-- Prev link for pagination -->

<xsl:if test="$selectedRowCount > 1">
 
<xsl:value-of select="number($Page)+1"> of <xsl:value-of select="number($selectedRowCount)">
 

<!-- Next link for pagination -->
<xsl:choose>
<xsl:when test="number($Page)+1 < number($selectedRowCount)">
 

<xsl:attribute name="href">
<xsl:value-of select="$PageURL">?page=<xsl:value-of select="number($Page)+1">&pagesize=<xsl:value-of select="$PageSize">

Next>>





</html>



Mydsh 27-Jan-16 2:31am View    
Great!!! Thanks a lot
Mydsh 27-Jan-16 1:55am View    
Thank You, but how do I link the url which are between link tags.
in the above xml we have <link> www.google.com </link>, that is casename and date as hyperlinks
Mydsh 1-Dec-12 11:18am View    
Here is my backend code

string ConnectionString = System.Configuration.ConfigurationManager.AppSettings["dbconnect"];
NewDAL dalObj = new NewDAL();
private DataSet dataSet;
protected void Page_Load(object sender, EventArgs e)
{


string MODE = Request.QueryString["MODE"];
ClientScript.RegisterHiddenField("__EVENTTARGET", "lbtn_search");
if (Session["CurrentFilter"] == null)
{
Session["CurrentFilter"] = "ALL";
}
HttpContext.Current.Session["PathLineMsg"] = "List of Relationship(s)".ToString();
BindData();
if (MODE == "HTML")
{
HTMLReport();
}
if (MODE == "PDF")
{
PDFReport();
}
if (MODE == "PRINT")
{
PrintReport();
}
private void HTMLReport()
{
int RelationsID = Convert.ToInt32(Request.QueryString["Rid"]);
HttpContext.Current.Session["RelationsID"] = RelationsID;
HtmlRendering(RelationsID);
//ClientScript.RegisterStartupScript(this.GetType(), "string", "javascript:PrintResults();", true);
}
if (impersonateValidUser("MSWord", "", "abcd123!"))
{
lblError.Visible = false;
WordApp oWord = new WordApp();

oWord.OpenAndPrint(wordPath, pdfpath);

undoImpersonation();

while (System.Diagnostics.Process.GetProcessesByName("WINWORD.EXE").Length > 0)
{

System.Windows.Forms.Application.DoEvents();

System.Threading.Thread.Sleep(100);

}

ReadPdfFile(pdfpath);

}