473,804 Members | 3,200 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I load Crystalreport with StoredProcedure in C#.

9 New Member
Hi friends...

I have one problem...
I am using C#, and CrystalReport9.
In my project I used StoredProcedure with one input parameter.

My Problem:

I would like to load my report.
But It seems lot of errors....

Please help me... "How can I load Crystalreport with Stored Procedure."
If u can give sample code also....

Thanking u....
Jul 23 '07 #1
2 3035
kenobewan
4,871 Recognized Expert Specialist
Yes you can use a stored procedure. What are the errors?
Jul 23 '07 #2
luwina
1 New Member
Hi,

Load a crystalreportvi ewer in your form. Put the code at Page_Load().


here's the code:
OdbcCommand com = new OdbcCommand("CA LL sp_name(?)", con);
com.CommandType = CommandType.Sto redProcedure;

com.Parameters. Add(new OdbcParameter(" ?param1", OdbcType.Int, 3));
com.Parameters["?periodid"].Direction = ParameterDirect ion.Input;
com.Parameters["?periodid"].Value = 41;

OdbcDataAdapter da = new OdbcDataAdapter ();
DataSet ds = new DataSet();

da.SelectComman d = com;
da.Fill(ds, "tablename" );

CrystalDecision s.CrystalReport s.Engine.Report Document myReportDocumen t;
myReportDocumen t = new CrystalDecision s.CrystalReport s.Engine.Report Document();
myReportDocumen t.Load(@"C:\ASP .NET\Reports\Re portName.rpt");
myReportDocumen t.SetDataSource (ds);
CrystalReportVi ewer1.ReportSou rce = myReportDocumen t;
CrystalReportVi ewer1.DataBind( );


Hope it helps :)

Luwina
Jul 27 '07 #3

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

Similar topics

0
1612
by: s-galit | last post by:
hi, i have a formula parameter in my crystalReport how can i initalize the parameter so that in every line in the crystalReport the parameter will have a different string? how to get to line in crystalReport? thanks thats what i have wrote till now but im getting in my field only "-" (in every line) For i = 0 To 9
3
15526
by: redneon | last post by:
I've populated a DataSet in my C# program and verified that it contains the data I passed it. I've then created a blank CrystalReport and set it's DataSource to my DataSet. Then I created a CrystalReportViewer and set it's ReportSource to my CrystalReport. When I run the program though nothing get's shown in my viewer. The following is how I did it... OdbcConnection dbConn = new OdbcConnection(); OdbcCommand dbCommand = new...
2
8489
by: Don Wash | last post by:
Hi All! I've been searching everywhere for a simple sample of producing a bar graph using CrystalReport by specifying SQL Query, and I've found none of it! I find so many complex samples with so many features buried in the sample but all I want to know is a very simple thing, how to create bar charts with CrystalReport in VS.NET using SQL Query. Could anyone provide me a sample showing how to produce a simple bar chart using SQL Query...
0
1437
by: Jay | last post by:
Following the help documentation, I can only get the report.Load method to work if I type in the full path. By toggling the commented line below, it proves that the report will open only when the path is provided. When the path is not provided, I get report cannot be found error - as listed at bottom of this post. I have tried all combinations of "@", "./", ".\", etc. Any help is greatly appreciated. myReport = new ReportDocument();...
0
1580
by: agcabutotan | last post by:
Hi to everyone. I am new in this thread, please help me. I'm having difficulty with CrystalReport.Net. I have a completed project written and compiled in VB.Net (and I used CrystalReport.Net in all of my reports). I used to connect in our SQL server using ADO datasets and It worked. Long after I created a new SQL server (not a member from the original server, a new server so-to-speak), with the same project, I am creating a new report but...
3
3695
by: Jason Huang | last post by:
Hi, In our .Net 2003 + CrystalReports 10, do we have an Exception Handler for ReportDocument.Load? Thanks for help. Jason
1
1819
by: mhsasono | last post by:
Hi all, Has anybody experienced with CrystalReport? My question is: Does CrystalReport have capability to print the Microsoft Word document? Reason: I want to know CrystalReport capability since now I am in the middle of developing a system that generate a report or document from various resources, e.g. some parts are Oracle fields and some parts are text of microsoft word object. Thanks in advance.
0
1393
by: amri | last post by:
How to define CrystalReport object in ASP.NET ? I take a CrystalReportViewer & CrystalReportSource........& their name is in CrystalReport is respectively CrystalReportViewer1 & CrystalReportSource1..............& I take a textbox object in CrystalReport ..............How can I define this textbox in ASP.NET form.........? advance Thanx Amritendu Paul
0
1218
by: amri | last post by:
How to define CrystalReport object in ASP.NET ? I take a CrystalReportViewer & CrystalReportSource........& their name is in CrystalReport is respectively CrystalReportViewer1 & CrystalReportSource1..............& I take a textbox object in CrystalReport ..............How can I define this textbox in ASP.NET web form.........?
0
9584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10583
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9160
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5654
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.