Pergunta

I am new in Crystal Report, I've created a Crystal Report successfully by following methods:

  • Created Crystal Report As Blank
  • get into Database Expert and create Database using OLE DB(ADO)
  • in OLE DB(ADO) I simply add tables into the Database and showed it on Crystal Report
  • Then I created a Win form on which I used Crystal Report Viewer
  • then I use following Code on Crystal Report Viewer Tab to call the Crystal Report

Code:

            var cryRpt = new ReportDocument();
            cryRpt.Load(@"C:\Users\Ahsan\Desktop\PROJECT INVENTORY SOFTWARE\InventorySoftware\InventorySoftware\Crystal Reports\CrystalReport2.rpt");
            crystalReportViewer1.ReportSource = cryRpt;
            crystalReportViewer1.Refresh();

Now what it does, it fetches complete table data, like if I have 500 records then it will load all the 500 records, and that's what I don't want to do.

What I actually need to do is to fetch data of a specific invoice number and I am not able to do this in any way.

I want it to fetch data for only that invoice number which is written on the form at run time, and the query through which I want to fetch data is build using Joins.

I am stuck and doing Google from past 3 hours but not able to do it.

Please dear SO fellows help me out. I will be very grateful.

Thanks.

Foi útil?

Solução

What I meant is:

Give your filtering in Record Selection formula, Now to sport record selection formula follow below path in crystal report:

Report ---> Selection Formula ----> Record

now a window is opened and enter your conditon there.

E.g: {Invoice Number}=1

Now run the report... you will get only data for Invoice Number 1

Use the link to understand the Record Selection Formula

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top