Click here to Skip to main content
13,006,530 members (62,697 online)
Rate this:
Please Sign up or sign in to vote.
0 down vote favorite
share [fb] share [tw]

I have created my crystal report using command (sql query) in crytal report itself, by passing two parameters, i.e, say for eg:- Month & Year, While i preview the report, i can able to navigate through all pages by passing different parameters and its working fine, but while viewing the report through browser i can't able to view the current report instead is loads the previously generated report, but while i manually make refresh the crystal page in toolbar i can see the current report, even i can't navigate the current report . Can anyone help me on this..........

Thanks in advance.
Posted 29-Dec-11 18:32pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

hi dinesh,
You can refresh the report after each binding by adding the following code.

Hope this will help you.


thatraja 30-Dec-11 3:54am
You beat me to it, Take a 5!
Dinesh_Diny 30-Dec-11 4:02am
Hi Sathish,
Thanks for your kind response. I tried with your suggestion but am getting error as "MISSING PARAMETER VALUES",
thanks....... any suggestions?
bluesathish 30-Dec-11 4:07am
Hi dinesh,
"MISSING PARAMETER VALUES" means you didn't pass the parameter value which you created in your report. Just verify that every parameters have got their curresponding values at runtime.
Dinesh_Diny 30-Dec-11 4:27am
Hi Sathish,
Do u got my prob, am i clear to you?
bluesathish 30-Dec-11 4:52am
Hi dinesh,
Yes, I think you've to set the data source BEFORE you add the parameters. So First the set the datasource to the report and then set the parameters to pass.

Dinesh_Diny 30-Dec-11 5:05am
Hi Sathish,

ok but,if i need to set datasource to the report before passing the parameter, where i should do it, b'coz i haven't passed any parameter from code behind. Or Can you able to provide me any code snippet to generate a parameterized report..
Thanks for your kind support!
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Hi Sathish,

For more info,

I have created my crystal report by using the command in Database expert of crystal report and created my parameters there. I'm not talking parameters from code behind, even it throws error.

My code is,
public partial class Reports_MyCrystalReport: System.Web.UI.Page
 SqlConnection sqlCon = new SqlConnection(ConfigurationManager.AppSettings["MYAPP"]);
 ReportDocument objCrystalReport = new ReportDocument();
 string Username = ConfigurationManager.AppSettings["RptUserName"];
 string Password = ConfigurationManager.AppSettings["RptPassword"];
 protected void Page_Init(object sender, EventArgs e)
        objCrystalReport.SetDatabaseLogon(Username, Password, @"DATABASE 
        CrystalReportViewer1.ReportSource = objCrystalReport ;              
        CrystalReportViewer1.DisplayToolbar = true;
        CrystalReportViewer1.HasPrintButton = true;
        CrystalReportViewer1.HasCrystalLogo = false;
 protected void Page_Unload(object sender, EventArgs e)

I'm a beginner working with crystal report, I'm not pretty sure whether the method i followed is right to create the crystal report, if i had made any wrong please help me on this. And suggest me the best way to achieve it..

Expecting your kind reply,

Thanks in advance,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170628.1 | Last Updated 30 Dec 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100