c# - Use view as Crystal Report datasource in Visual Studio 2010 -
i want use crystal reports in website , want display 2 different tables in report. underrstand, should use view, don't know how should use it, or code should write in code behind crystal report viewer?
can tell me should here?
you need add crystalreportviewer
control page want show crystal report on:
<cr:crystalreportviewer id="crystalreportviewer1" runat="server" autodatabind="true" />
then in code:
reportdocument myreportdocument = new reportdocument(); myreportdocument.load("thenameofyourcrystalreportfile.rpt"); myreportdocument.setdatasource(yourdataset); crystalreportviewer1.reportsource = myreportdocument;
once set reportsource, should prompt parameters.
look @ here references crystalreportviewer , reportdocument.
for loading xsd file dataset:
dataset yourdataset = new dataset(); dataset.readxmlschema("dataset1.xsd");
Comments
Post a Comment