.net - Call report from C# class file -


how can call existing crystal report c# class file?

my method in class file has parameter string callcrystal(string num). report in located in d:/reports/employedetails/ displays employee detail passing in string input.

the method should send string parameter (num) , call report crystal report.

you need crystalreportviewer control. has reportsource property which, inter alia, can set path of existing report, case. in order add parameters, in addition need use parameterfieldinfo member collection of parameterfields. set follows:

parameterfields paramflds = new parameterfields(); parameterfield param = new parameterfield(); parameterdiscretevalue paramval = new parameterdiscretevalue(); param.name = "myname"; paramval.value = myvalue; param.currentvalues.add(paramval); paramflds.add(param); 

i use single "host" form containing 1 control, crystalreportviewer. view report, create instance of form, passing in whatever parameters need (at least parameterfieldinfo, in case including path well) , call host.show() view report.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -