473,320 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Display bulk of records in tabular format using Crystal report viewer

Hi Everyone,

I would like to display application form as tabular format for that am using crystal report viewer..Here my issue is in my table I have bulk of data's but when i run my application it shows only 1st row of the table..I would like to display all the records which are present in table..

Here am using C# winforms,visual studio 2010,sql server 2008..

Here is my code:
Expand|Select|Wrap|Line Numbers
  1. private void Report_Load(object sender, EventArgs e)
  2.         {
  3.             ReportDocument crystalreport = new ReportDocument();
  4.             crystalreport.Load(@"D:\Development\VS2010 Projects\MVC Applications\Application_Print_CrystalReports\Application_Print_CrystalReports\leavereport.rpt");
  5.              //Here am writing query to display all the records which are present in the table
  6.             Customers dscustomers = GetData("Select * From Leave_Form");
  7.             crystalreport.SetDataSource(dscustomers);
  8.             crystalReportViewer1.ReportSource = crystalreport;
  9.             crystalReportViewer1.Refresh();
  10.             crystalReportViewer1.Dock = DockStyle.Fill;
  11.             this.Controls.Add(crystalReportViewer1);
  12.         }
  13.  
  14.         //Here customers is my dataset name
  15.         private Customers GetData(string query)
  16.         {
  17.             string conString = ConfigurationManager.ConnectionStrings["Myconn"].ConnectionString;
  18.             SqlCommand cmd = new SqlCommand(query);
  19.             using (SqlConnection con = new SqlConnection(conString))
  20.             {
  21.                 using (SqlDataAdapter sda = new SqlDataAdapter())
  22.                 {
  23.                     cmd.Connection = con;
  24.                     con.Open();
  25.                     sda.SelectCommand = cmd;
  26.                     using (Customers dscustomers = new Customers())
  27.                     {
  28.                         sda.Fill(dscustomers, "DataTable1");
  29.                         return dscustomers;
  30.                     }
  31.                 }
  32.             }
  33.         }
Here is the snap shot of my application:

Attached Images
File Type: jpg lf.jpg (21.9 KB, 285 views)
Dec 7 '15 #1
2 1631
madankarmukta
308 256MB
You hav to extract which property of the report should be set to set the no. Of records.

There has to be certainly, if more than one record, needs to show in the report.

Regards.
Dec 13 '15 #2
Hi,

Could you please explain with some more in detail..I am new to crystal report..If i use like normal table it shows all the rows present in table instead of normal table if I design like application form then it shows only 1st row of the table...
Dec 14 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ashish Shridharan | last post by:
Hi All, I'm not very sure if this is the forum for my question but i was hoping someone could direct me to the right place (or answer my question). I am using the .NET crystal report viewer...
7
by: mrwoopey | last post by:
I have a asp.net application that uses the crystal report viewer control. It displays all of my reports but all of a sudden it started giving me the following error on ONLY two reports: "Fail...
0
by: Ahmed Marghani | last post by:
Hi Dear i am using Crystal Report Viewer control in ASP.NET to display crystal reoprt under windows 2000 professional. the control work well but i can't see the charts it the control any one...
0
by: louise raisbeck | last post by:
Hi, The first part of this code def works as i have an export function which saves my crystal report, as a pdf, to disk. However they want to be able to view them before deciding to save them. I...
1
by: EDom | last post by:
Hi, I am using Crystal report viewer to display my reports with asp.net pages on the web. How can I provide a printing option as it is not available in crystal viwer. Is there any work around....
0
by: Jaiganesh | last post by:
Are there any possible ways to read the HTML content rendered/generated from the Crystal Report Viewer XI using ASP.net from the code behind file? If so, please let me know the correct event/method...
0
by: mano.bharath | last post by:
I am developing a windows application in VB.NET 2005 that includes a number of crystal reports. To use the reports I use the included crystal report viewer and pass a dataset to the report at...
1
by: Daysee | last post by:
How can i display a JPEG file from a dedicated path? example: fileformat is => <fieldname.JPEG> An image will be display depends on their user_id.JPEG. daysee
1
by: CAM | last post by:
Hello, I am using Vista Basic.Net 2008 and I wondering what is the best way to display crystal reports in a form. I have about 10 different crystal reports what I am currently doing is using a...
0
by: mohanty2050 | last post by:
I am using Crystal Report 9 and VB6.0. I can display the report through Crystal report viewer properly. But the print button in the Crystal report viewer does not work. My printer is in network. If I...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.