Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
hello everyone...
 
I m currently using vs2010. In that i want to generate crystal report for invoice.
 
My database tables are Table 'A' and Table 'B' which are as follows
-----------------------------------------------------------------
Table 'A'
------------------------------------------------------------------
invoiceid  | invoicedate | subtotal | tax1  | tax2 | Grand Total
 
   1          07/13/2012     500.00    VAT    CST      700
   2          09/08/2011     800.00    VAT    Sales    1000
------------------------------------------------------------------
 

-----------------------------------------------------------------
Table 'B'
------------------------------------------------------------------
invoiceid  | invdetid  | itemno | itemname  | qty | rate  | amount
 
   1            1         1        item A      5     10.0    50.0
   1            2         2        item B      3     5.00    15.00 
   2            3         1        item A      10    12.00   120.00 
------------------------------------------------------------------
so here..i m using dataset in which, i m taking two tables,i.e. Table 'A' and
Table 'B'
and my query in procedure is
select A.invoiceid,A.invoicedate,A.subtotal,A.tax1,A.tax2,A.Grand Total,
       B.invoiceid,B.invdetid,B.itemno,B.itemname,B.qty,B.rate,B.amount
 from Table A,Table B
where A.invoiceid=B.invoiceid
so by this query i m getting result by invoice number.
 
My aspx.cs code is
---------------------
Con = new SqlConnection(strConnString);
                Con.Open();
                cmd.CommandText ="TestReport";
                cmd.CommandType = CommandType.StoredProcedure;
                
                cmd.Connection = Con;
                adapter = new SqlDataAdapter(cmd);
                ds = new DataSet();
                adapter.Fill(ds,"A");
                adapter.Fill(ds,"B");
                rptDoc.Load(Server.MapPath("/Report/InvoiceReport.rpt"));
 
                
                rptDoc.SetDataSource(ds);
                CrystalReportViewer1.ReportSource = rptDoc;
                CrystalReportViewer1.RefreshReport();
-------------------------------------------
here i m getting data in dataset ..but while displaying it is showing no data on report..
 
please help..
 
Thanks in advance
Posted 12-Jul-12 21:14pm
Edited 13-Jul-12 0:43am
v4
Comments
Sandeep Mewara at 13-Jul-12 2:50am
   
You got one query in SP and you are filling dataset twice using adapter, can you share it why?
 
Further, did you check if the data is returned and filled in dataset before assigning to reports? DEBUGGED it?
Kuldeep B at 11-Dec-12 1:45am
   
Use two datasets and then use Merge methode..
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

im also having the same query please someone help me.....!!!!!!pls
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You need to write your query in command of ur design report page for the fields that you display in report. for more you can refer below links:
 
Step by Step Creation of Crystal Report using its Features Group, Graph, Cross-Tab and Sub Report,
 
Generate a Report using Crystal Reports in Visual Studio 2010
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 341
1 Marcin Kozub 225
2 Sergey Alexandrovich Kryukov 220
3 Praneet Nadkar 197
4 Shweta N Mishra 161
0 OriginalGriff 8,149
1 Sergey Alexandrovich Kryukov 7,287
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,910


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 14 May 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100