c# - Crystal Report not passing parameters to subreport -


i have configurable win forms app in can set how times subreport can inserted main report this:

config page: (order of importing subreports)

subrep1 subrep1 subrep1 subrep3 subrep3 subrep2 subrep2 subrep2

so, in main report import/insert 3 times subreport 1, 2 times subreport 2 , 3 times subreport 2. each subreport has 1 parameter , set through code value, appears on first instance of report...

so, this:

subrep1 (has parameter) subrep1 subrep1 subrep3 (has parameter) subrep3 subrep2 (has parameter) subrep2 subrep2

the problem need have parameter each one! code...

setmainreportparameters(reportparameterlist);                  (int = 0; < rlc.reportlayout.count; i++)                 {                     if (rlc.reportlayout[i].subreportname == "sectionreporttest1.rpt")                     {                         setsectiononereportparameters(reportparameterlist);                     }                     if (rlc.reportlayout[i].subreportname == "sectionreporttest2.rpt")                     {                         setsectiontworeportparameters(reportparameterlist);                     }                     if (rlc.reportlayout[i].subreportname == "sectionreporttest3.rpt")                     {                         setsectionthreereportparameters(reportparameterlist);                     }                 } 

and when passing...

//list of every parameter (main , subreports)                 foreach (var current in reportparameterlist)                 {                     if (string.isnullorempty(current.subreportname))                     {                         document.setparametervalue(current.name, current.value);                     }                     else                     {                         document.setparametervalue(current.name, current.value, current.subreportname);                     }                 } 

in *.rpt file of main report need add links between subreports , main report , pass parameters values in there. should available in context menu of subreport object in template.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -