on 2014 Jun 19 10:25 PM
I'm using CR for Visual Studio 2010-2012. On my development and production servers (Windows Server 2008 R2 and 2012 R2) I have updated the 32-bit and 64-bit SP2 to SP9.
Many reports are embedded in a VB asp.net page. After installation of SP9, pagination would never go past page 2 anymore. After reinstalling SP2 on my development server, this is working again. I did not try the intermediary SP's. Is this a bug ? Thank you.
It is not a bug. I suspect your code is in page load(?). Move your code to page init as this will initialize the viewer better than page load.
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What does the report look like in the designer on the same computer? Download the CR 2013 eval and check. The Eval can be downloaded from here:
SME Free Trials | SME Software | SAP
- Ludek
Hello Ludek,
Let me repeat the problem.
I have a fair number (100+) of Crystal reports on several websites and in most of them I use selection parameters.
In the past I have used Crystal Report XI because I was in need of dynamic images, and those were not available in Crystal Reports for VS at the time.
My development server is Windows Server 2008 R2, my production server is Windows Server 2012.
I use Visual Basic in my aspx pages, which is part of the problem because very few examples are to be found on the internet.
Until recently I had Crystal Reports for Visual Studio SP 13.0.2.469 installed on both servers.
To have CR integrated into an eventual VS2013, I decided to upgrade to SP 13.0.9.1312.
I was only after a few days that I was advised by customers that the pagination of the reports was no longer working. In fact pagination works up to page 2, and no further. Printing and exporting work fine.
I have spend many days trying to fix this.
The two suggestions that I come across everywhere are
1. Use Page_Init instead of Page_Load
2. Put the reportsource in the session
I tried that in many ways, to no avail.
When reverting to SP 2 instead of SP 9 my reports work fine again.
The browser makes no difference.
The only subject I have not sorted out is the apnet_client folders in the website’s directories.
These seems to be the older versions of crystalreportviewers.
Also, I’m using only 64-bit computers. Do I need to install the 32-bit euntimes ?
Mayb the logic of my aspx pages is no good, but even after having this checked with a specialist, we found no solution.
The websites involve Youth Exchange and contain confidential information.
Of course I’d be happy to send you one of the aspx pages.
Hello Ludek,
To illustrate my problem kindly have a look at a specific page on my development server :
This report paginates properly. CR SP2 is installed on that server.
and then on my production server :
This report does not paginate properly. CR SP9 is installed on this server.
If I use the page.init, or if I put the report in the session, I get other problems.
This is the code of my aspx page :
<%@ Page Language="VB" %>
<%@ Register TagPrefix="CR" Namespace="CrystalDecisions.Web" Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" %>
<!DOCTYPE html>
<script runat="server">
Dim oRpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
Dim strDistrict As String = ""
Dim strDistrictNr As String = ""
Dim strSubDistrict As String = ""
Dim strSeason1 As String = ""
Dim strSeason2 As String = ""
'************
'On Page Load, (not Init !!!!! )
'************
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
LoadReport()
End Sub
Protected Sub CrystalReportViewer1_Navigate(ByVal source As Object, ByVal e As CrystalDecisions.Web.NavigateEventArgs)
'Necessary to make sure page 2 and next ones apply selection
'Do not repeatr binding here
If Not IsPostBack Then
LoadReport()
End If
End Sub
'**********************
'Functie LoadReport()
'=> Het rapport inladen
'**********************
Sub LoadReport()
oRpt.Load(Server.MapPath("out_students_report_picture.rpt"))
strDistrict = "1620"
strDistrictNr = "1620"
strSubDistrict = "x"
strSeason1 = ddlSeason1.Text
strSeason2 = ddlSeason2.Text
Label3.Text = strDistrict
Label1.Text = strDistrictNr
Label2.Text = strSubDistrict
Label4.Text = strSeason2
Label5.Text = strSeason1
'report.SetDatabaseLogon("username", "password", "sqlserver", "database")
oRpt.SetDatabaseLogon("xxx", "xxx", "xxx", "xxx")
oRpt.SetParameterValue("SelDistrict", strDistrict)
oRpt.SetParameterValue("SelSubdistrict", strSubDistrict)
oRpt.SetParameterValue("SelDistrictNr", strDistrictNr)
oRpt.SetParameterValue("SelSeason1", strSeason1)
oRpt.SetParameterValue("SelSeason2", strSeason2)
CrystalReportViewer1.ReportSource = oRpt
End Sub
'***********
'Page_Unload
'***********
Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs)
oRpt.Close()
oRpt.Dispose()
GC.Collect()
End Sub
Protected Sub Button1_Click(sender As Object, e As EventArgs)
LoadReport()
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lblTitle" runat="server" Text="Report per name with picture" />
<br />
<br />
<table>
<tr>
<td style="width: 150px">
<asp:Label ID="lblSeason1" runat="server" Text="First season:"
Height="20px"></asp:Label>
</td>
<td style="width: 250px">
<asp:DropDownList ID="ddlSeason1" runat="server" DataSourceID="SqlDataSource1"
DataTextField="Season" DataValueField="Season" >
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ryedb300ConnectionString %>"
SelectCommand="SELECT DISTINCT Season FROM SEP_OUT_TA_EtudiantOut WHERE ((District = @District) AND (DistrictNr LIKE '%' + @DistrictNr + '%') AND (Subdistrict = @Subdistrict) AND (Canceled = @Canceled)) ORDER BY Season DESC">
<SelectParameters>
<asp:Parameter DefaultValue="1620" Name="District" Type="String" />
<asp:Parameter DefaultValue="1620" Name="DistrictNr" Type="String" />
<asp:Parameter DefaultValue="x" Name="Subdistrict" Type="String" />
<asp:Parameter Name="Canceled" DefaultValue="False" Type="Boolean" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td style="width: 150px">
<asp:Label ID="lblSeason2" runat="server" Text="Second season:"
Height="20px" ></asp:Label>
</td>
<td style="width: 250px">
<asp:DropDownList ID="ddlSeason2" runat="server" DataSourceID="SqlDataSource1"
DataTextField="Season" DataValueField="Season" >
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ryedb300ConnectionString %>"
SelectCommand="SELECT DISTINCT Season FROM SEP_OUT_TA_EtudiantOut WHERE ((District = @District) AND (DistrictNr LIKE '%' + @DistrictNr + '%') AND (Subdistrict = @Subdistrict) AND (Canceled = @Canceled)) ORDER BY Season DESC">
<SelectParameters>
<asp:Parameter DefaultValue="1620" Name="District" Type="String" />
<asp:Parameter DefaultValue="1620" Name="DistrictNr" Type="String" />
<asp:Parameter DefaultValue="x" Name="Subdistrict" Type="String" />
<asp:Parameter Name="Canceled" DefaultValue="False" Type="Boolean" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td style="width: 150px">
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Show report" />
</td>
<td style="width: 250px">
</td>
</tr>
</table>
<asp:Label ID="Label3" runat="server" Text="District"></asp:Label>
<br />
<asp:Label ID="Label1" runat="server" Text="Districtnr"></asp:Label>
<br />
<asp:Label ID="Label2" runat="server" Text="Subdistrictnr"></asp:Label>
<br />
<asp:Label ID="Label5" runat="server" Text="Season1"></asp:Label>
<br />
<asp:Label ID="Label4" runat="server" Text="Season2"></asp:Label>
<br />
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" Height="50px" ReportSourceID="CrystalReportSource1" Width="350px" EnableDatabaseLogonPrompt="False" EnableParameterPrompt="False"
HasCrystalLogo="False" ReuseParameterValuesOnRefresh="False" HasToggleGroupTreeButton="False"
HasToggleParameterPanelButton="False" HasDrilldownTabs="True" ToolPanelView="None" OnNavigate="CrystalReportViewer1_Navigate" />
<CR:CrystalReportSource ID="CrystalReportSource1" runat="server"></CR:CrystalReportSource>
<br />
</div>
</form>
</body>
</html>
http://m1.dyndns.org:6018/cr.aspxhttp://m1.dyndns.org:6018/cr.aspxhttp://m1.dyndns.org:6018/cr.aspx
Hi Philippe,
I found a few good articles on too use these various Page commands:
http://www.cryer.co.uk/brian/csharp/ms_dotnet_order_of_page_events.htm
And MS references in there also:
http://msdn.microsoft.com/en-us/library/ms178472(v=vs.100).aspx
So what you need to do is handle the page PostBack so the correct object in Session so you must use Sessions also.
Fiddler should show you what is happening.
Bottom line is CR DEV "fixed" the Viewer to trigger in the correct Page Events according to the Rules...
Don
User | Count |
---|---|
69 | |
11 | |
10 | |
10 | |
9 | |
7 | |
7 | |
7 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.