Click here to Skip to main content
15,885,925 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I am working on a project ...need to show report ... on crystal report.



can some one tell me the string used for report path in the form?
Posted

ok now let me get this straight u need to load some report of urs right well my friend hers what u have to do for that

once u have configured ur crystal report all u have to do is take another form drag and drop a crystal report viewer on that form now u have to configure ur crystal report viewer for the viewing of the desired report, for that crystal report viewer component has a property called as Report Source once u click on it it will give u a set of report which u have in ur application select the desired report and ur done.

Now u must have a question for configuring the report for display well my friend crystal report component does all that by itself and dont worry at all regarding the setup and all crystal report will work fine if and only if u have designed and configured the report as per ur requirements otherwise u can also convert the crystal report into PDF format if ur still having doubt regarding crystal report once the report is converted into PDF format u can easily dispaly the PDF file with the help of a COM component the two namespaces for converting crystal report to pdf are
VB
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared


and hers the link that will guide u in converting a crystal report into PDF format
CRYSTAL REPORT INTO PDF FORMAT[^]

in the above link u will come across a line of code which says
MIDL
cryRpt.Load(PUT CRYSTAL REPORT PATH HERE\\CrystalReport1.rpt");

well nothing to worry about just add in the path where ur crystal report is for example say ur crystal report is in D drive in a folder called negi and the nae of ur report is Myreport.rpt so u can modify the code and write

MIDL
cryRpt.Load(@"D:\negi\Myreport.rpt");

thats it

Remember the above code is in C# i feel u can easily convert it into VB.NET

Please Rate my answer once u find it useful
Thanks & Regards
Radix :rose:
 
Share this answer
 
hi try this code I use and this work Nicelly

but

first u create a one data set and dataset column same name in table column name(case sensitive)

then

Insert Dataset column in your crystal Report Design

then
Get data from Table and load in dataset there after data set load in Crystal Report.

Dim report As CrystalReportName= New CrystalReportName
Dim sReader As SqlDataReader
Dim dataT As New DataTable

cmd.commandTex="Your Sql Query Here"

sReader = cmd.ExecuteReader
dataT.Load(sReader)

report.SetDataSource(dataT)

CrystalReportViewerName.ReportSource = report
CrystalReportViewerName.Refresh()
 
Share this answer
 
v3
Hello
You can add Crystal Report by clicking in the solution explorer and then selecting AddNewItem and thn select Crystal Report u will get a crystal report in your project but before that it will show you a crystal report gallery from their select the type of report you want and then go to the field explorer window and select database field option right click it and select database expert option and from their go to
Create new connection>> OLE DB(ADO)and select your database say if ur working with sql select Microsoft OLE DB provider for SQL server select your table click on next and then finish and then you are ready to go

Do rate my answer once u find it useful

Thanks & Regards
Radix :rose:
 
Share this answer
 
hello,
if u want this application to run into all ur client application then install this application into the server, well i am not preety good in networking than in coding but this might help u also friend make sure that if ur installing ur application into the server or at any desktop then please make sure of the following stuff:

A) How much Memory is ur application occupying onto the server?
B) Have u disposed ur connection class object?
C) Have u performed proper validation?
D) How's the look n feel of ur application?
E) Are all the client requirements meet?
F) Have u tested ur application properly via testing rules?

Hint: Ask a person who is not from programming field to use ur application if he uses it perfectly then hurray congrats ur application is successful, i know it may sound wierd but friend i do the same thing i give my brother to test the application and u know what he always spots some important errors which we programmers cant see while coding, This little trick worked for me i hope my friend it may help u to some extent in making ur application robust...


Thanks & Regards
Radix :rose:
 
Share this answer
 
v2
^^
brother it is ok i will do it.... but i was trying to ask

how to load report in a crystal report viewer? as we know we have to put crystal report viewer on a form in vb.net. we can add report directly but selecting report source n that works only in your system or in that directry where you are working.... wen u deploy that app..report will not work.. for that we need to add report in form mannually by write code on the load of form... i need that code wich is the path of the report?
 
Share this answer
 
@Above


hey buddy thank you for ur time:)

but i need that crystal report path at run time when i will install this app to another system. for that i need a dynamic string path where u write Crystal report path in

Cr.load(path)

i need something Application.StartUpPath & \\ .......so on thats i am missing

it will work at runtime in every system. if i give path like F:\\cry\cr.rtf it will work only in current system. not in other system :)

but stilll i will try it thank you... once it works i will let u know
 
Share this answer
 
:) guys still i am sort of the solution.... Anyone out there have worked with Crystal Report????? in vb.net or c#.net
 
Share this answer
 
still no response ok..... seems crystal report are very tough for all :(
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900