Reputation: 43
I´ve designed a report with 2 simples tables Province->District, then added a parameter where param=Province.Name
Then using the select expert i connected the parameter with the report for a select expression.
When i load the report the parameters get loaded into a combo box with all provinces and when i select one, a loading symbol apears and in the end of the loading nothing happens, the prompt just apears again, like i didint chose anything.
ps: the report works perfetly without parameters, all provinces and districs are displayed.
My code is like this on the page init:
base.OnLoad(e);
String id = Request.QueryString["id"];
ReportService ReportService = new ReportService(base.ContextData);
CRYSTAL_REPORT cr = ReportService.GetCReportByID(Convert.ToDecimal(id));
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString);
ReportDocument cryRpt = new ReportDocument();
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
ConnectionInfo crConnectionInfo = new ConnectionInfo();
Tables CrTables;
cryRpt.Load(cr.FILE_NAME);
crConnectionInfo.DatabaseName = builder.InitialCatalog;
crConnectionInfo.UserID = builder.UserID;
crConnectionInfo.Password = builder.Password;
crConnectionInfo.ServerName = builder.DataSource;
cryRpt.SetDatabaseLogon(builder.UserID, builder.Password, builder.DataSource, builder.InitialCatalog);
CrTables = cryRpt.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
{
crtableLogoninfo = CrTable.LogOnInfo;
crtableLogoninfo.ConnectionInfo = crConnectionInfo;
CrTable.ApplyLogOnInfo(crtableLogoninfo);
}
CrystalReportViewer1.ReportSource = cryRpt;
CrystalReportViewer1.DataBind();
And my aspx is only contains 1 control
<CR:CrystalReportViewer ID="CrystalReportViewer1" HasToggleParameterPanelButton="true" ReuseParameterValuesOnRefresh="true" runat="server" EnableDatabaseLogonPrompt="false" EnableParameterPrompt="true" AutoDataBind="True" Width="100%" HasCrystalLogo="False" />
any ideas? thanks in advance
Upvotes: 0
Views: 118
Reputation: 43
Solved, Note for future reference, dont use updatepanels with the crystalreportviewer.
Upvotes: 1