on 07-17-2013 10:17 AM
Dear All,
I am using Visual Studio 2010 and its built-in Crystal Reports in ASP .Net.
On Crystal Report I have more then 1 pages and I am on first page when I click on "Go to Next Page", progress bar start and continuous start not move on the next page but in Page Navigation text box shows 1 of 2. My all code is in Page_Init() already.
Please anyone can tell me.... How can I get rid of this problem??????
Thanks & Regards;
See if placing the report object in session will help. Also, make sure you're on SP 6.
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter
Got Enhancement ideas? Try the SAP Idea Place
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for quick response,
Let me tell you one thing that I am using CrystalDecisions.CrystalReports.Engine.ReportClass instead of CrystalDecisions.CrystalReports.Engine.ReportDocument
I have already done; placing the report object in session but didn't get the required result. in Page Navigation text box shows 2 of 2 but 2nd page didn't display.
Thanks & Regards;
Yes... I have 4 pages of my report and when I Export in pdf or in other format, I get all pages but move to next page not working.. I have also re-installed the SP6, Below is code which I am using..
protected void Page_Init(object sender, EventArgs e)
{
SqlConnection objSqlCon = null;
SqlCommand objSqlCmd = null;
SqlDataAdapter objSqlAdap = null;
try
{
objSqlCon = new SqlConnection(strConnectionString);
objSqlCmd = new SqlCommand();
objSqlCmd.CommandType = CommandType.StoredProcedure;
objSqlCmd.CommandText = "procGetDataForReport";
objSqlCmd.CommandTimeout = 0;
objSqlCmd.Connection = objSqlCon;
objSqlCmd.Parameters.AddWithValue("@Param_1", "Value1");
objSqlCmd.Parameters.AddWithValue("@Param_2", "Value2");
objSqlCmd.Parameters.AddWithValue("@Param_N", "Value3");
objSqlAdap = new SqlDataAdapter(objSqlCmd);
DataSet dsReport = new DataSet();
objSqlAdap.Fill(dsReport);
dsSubReport = GetCrSubReportData(ref objSqlCmd, ref objSqlAdap, dsSubReport);
object rptCrystalReport = SH.Reports.ReportInfo.GetReport("SH.Reports.Tracking.rptFuelAnalysiss"); // Get Report Very well
objRRpt = (ReportClass)rptCrystalReport;
ParameterFields paramFields = new ParameterFields();
ParameterField paramField;
ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
paramField = new ParameterField();
paramField.Name = "strPrintedBy";
paramDiscreteValue = new ParameterDiscreteValue();
paramDiscreteValue.Value = "Printed By Name";
paramField.CurrentValues.Add(paramDiscreteValue);
paramFields.Add(paramField);
paramField = new ParameterField();
paramField.Name = "strLogedOnLocationName";
paramDiscreteValue = new ParameterDiscreteValue();
paramDiscreteValue.Value = "LogedOn Location Name";
paramField.CurrentValues.Add(paramDiscreteValue);
paramFields.Add(paramField);
paramField = new ParameterField();
paramField.Name = "strCriteria";
paramDiscreteValue = new ParameterDiscreteValue();
paramDiscreteValue.Value = "No Criteria";
paramField.CurrentValues.Add(paramDiscreteValue);
paramFields.Add(paramField);
paramField = new ParameterField();
paramField.Name = "strReportCaption";
paramDiscreteValue = new ParameterDiscreteValue();
paramDiscreteValue.Value = "Report Caption";
paramField.CurrentValues.Add(paramDiscreteValue);
paramFields.Add(paramField);
crRptViewer.ParameterFieldInfo = paramFields;
objRRpt.SetDataSource(dsReport);
SetCrSubReprtDataSource(ref objRRpt, ref dsSubReport);
TableLogOnInfo objTblLogOnInfoForRpt = new TableLogOnInfo();
for (Int32 intCntr = 0; intCntr < objRRpt.Database.Tables.Count; intCntr++)
{
objTblLogOnInfoForRpt.ConnectionInfo.ServerName = objSqlCon.DataSource.ToString().Trim();
objTblLogOnInfoForRpt.ConnectionInfo.DatabaseName = objSqlCon.Database.ToString().Trim();
objTblLogOnInfoForRpt.ConnectionInfo.UserID = "sa";
objTblLogOnInfoForRpt.ConnectionInfo.Password = "Password";
objTblLogOnInfoForRpt.ConnectionInfo.IntegratedSecurity = false;
objRRpt.Database.Tables[intCntr].ApplyLogOnInfo(objTblLogOnInfoForRpt);
objRRpt.Database.Tables[intCntr].Location = objTblLogOnInfoForRpt.ConnectionInfo.DatabaseName + ".dbo." + objRRpt.Database.Tables[intCntr].Location.Substring(objRRpt.Database.Tables[intCntr].Location.LastIndexOf(".") + 1);
}
objRRpt.SetDatabaseLogon(objTblLogOnInfoForRpt.ConnectionInfo.UserID, objTblLogOnInfoForRpt.ConnectionInfo.Password, objTblLogOnInfoForRpt.ConnectionInfo.ServerName, objTblLogOnInfoForRpt.ConnectionInfo.DatabaseName);
crRptViewer.ReportSource = objRRpt;
}
catch (Exception Ex)
{
throw Ex;
}
finally
{
if (objSqlCon != null)
{
objSqlCon.Close();
objSqlCon.Dispose();
}
if (objSqlAdap != null)
{
objSqlAdap.Dispose();
objSqlAdap = null;
}
if (objSqlCmd != null)
{
objSqlCmd.Dispose();
objSqlCmd = null;
}
}
}
I have commented the code for LogOnInfo and after that my report is not showing the data even, I have attached an Image of error (Datbase Logon Failed)
Please share some code or link, load report with ReportClass to get rid of this problem, I am really in trouble due to this...
Thanks & Regards
-- Imran
Here is what I want you to do - as a test:
1) Backup the report
2) Delete the subreport
3) The only code I want in your project as far as CR is concerned (e.g., no parameter code, no nothing):
Dim objRRpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
objRRpt.Load("C:\TESTS\font.rpt")
objRRpt.SetDataSource(dsReport);
CrystalReportViewer1.ReportSource = crReportDocument
The behavior should be: the viewer coms on the screen. parameter prompt screen appears. You enter the params. Report should show up in the viewer with no errors.
Does that work?
- Ludek
Thanks Ludek, Its work as you described and
My problem has been resolved, problem was occurring due to report parameters, On my report there were many parameters and 2 of them are @dtFrom and @dtTo and the values for these parameters going which creating problem
e.g;
@dtFrom = {7/25/2013 12:00:00 AM}
@dtTo = {7/25/2013 12:00:00 AM}
so I changed the format like
@dtFrom = objController.dtFrom.Date.ToString("yyyy-MM-dd")
@dtTo = objController.dtTo.Date.ToString("yyyy-MM-dd")
and It Works....... Cheers........
Thanks a lot for your coperation...
-- Imran
I have run into a similar problem with SP6.
I have an ASP.NET project in Visual Studio 2012.
If the report has more than 2 pages, the viewer will move to page 2 using the Next Page button, but will not move past page 2 using the Next Page button. If you use the Go to Last Page button it will go to the last page, but then if you click the Previous Page you go back to the first page.
I uninstalled the SP6 (32-bit runtime) and re-installed SP5 and everything is working again. I have tested this on Windows 8, Windows Server 2008 (32-bit) and Windows Server 2008 R2 (64-bit) and it is the same on all 3.
Has anyone else had this problem?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.