Wednesday, March 7, 2012

Crystal Report

Dear All,
If you have any doubt in Seagate Crystal Reports contact me, i will help you my level best.
Babu
Present EMail : kbabu@.qmaxtest.com
Permanent EMail : k_babs@.hotmail.com
WebSite : qmaxtest.comHi,
How to send a crystal report directly to printer by using ASP.
Thanks.|||hi

use property Destination = 1(to printer) this will send output directly to printer without preview screen.

Babu.

MailID: k_babs@.hotmail.com|||Hi

How do I open a password protected .mdb database in Crystal when the report is called from a VB application. I can't get it opened.

Bezzie|||this is not an answer. If you get an answer to your problem could you please forward it to me. i am also intrested in creating an opening a .mdb database with a password from my vb code. From what I read (your question) it souds like you are already doing this. thanks

theghost@.bellsouth.net|||hi

Use the following small code to access login and password from crystal report.

crCommon.LogonInfo(0)= "dsn=;uid=;pwd=madras;dsq="
crCommon.DataFiles(0)= "C:\Mydata.mdb"

MailID: k_babs@.hotmail.com|||Thanks

I get it to work with reports that hasn't got subreports in them but the ones with subreports still crashes. How will i get them to work.

Bezzie|||I want to build a report on the basis of sql server 2000 udf which is a parameterized function directly without involing any stored procedure in.. problem is that normal driver of sql server does not recognize function .. and if i used ado or other drivers it does not give any parameters instead it allowed me to write a Query like
select * from aUDFunction ('01-Jul-2001', '30-Jun-2002') and all the times this working with the same values ... I am working in VB now a days.. I also tried to change the Query by SQLQuery property of OCX Control but a report create with ADO etc does not allow to use this Property... Please Help.. Thanx.. Nasir

AITG|||hi,
Normally, SqlQuery Property accurs any error in your Sql statement it will skip and reset the default design value.

In SqlQuery Property you can't change the select columns, you can changle only FROM WHERE GROUP Class.

Thanks,
K.Babu

MailID: k_babs@.hotmail.com|||I need to print bitmap for any products on a catalog. The database (file .dbf) field contents the path of the bitmaps.
Is it possible to print the bitmap for the products from Crystal Report 5.0.
If yes, how can I do ?
thanks|||hi,

Stores all pictures in database files using with OLE Object type.

Add the picture field in your crystal report.

yours,
K.Babu

MailID: k_babs@.hotmail.com|||I am having problem designing crystal report using a generic printer driver.
The fields shown ok viewing on the screen, but when print out, the data is out of place.

Example
Field 1 on line 4 printed on line 3.

Any suggestions?|||I want to design a report with unicode data.
My datatbase use unicode).
but Crystal report use ANSI.
Help me,
Thank you.|||hi,

Try changing fonts, Printer font or windows Courier New font.

yours,
K.Babu

MailID: k_babs@.hotmail.com|||hi,

if your database support ODBC Driver, you can use ODBC DSN name in crystal report.

yours,
K.Babu

MailID: k_babs@.hotmail.com|||Thanks for ur mail.but
Which control has this propery.
what about sql database (Set database location)
after setting do i need to save the rpt
regards|||hi,

CrystalReport control has datafiles() property.

Once you connect and finished crystal report design, The CrystalReport datafiles() property works common for all backend database.

yours,
K.Babu

MailID: k_babs@.hotmail.com|||Hi !

I am experiencing some problems with DiscardSavedData.

I am using CrystalReport 8.0 with RDC and when i wish that every time that i am opening my report to refresh all the data from it. With tha older versions of crystal report that worket with ocx I did not have any problem with this.

On the design on the menu from the right click i haved found Desisgner/Defaul Settings... and there i have'd found Reporting. In there is a check box named Discard Saved Data When Loading Reports. It looks ol ok but it wont stay clicked. After i run my aplication, i am going back and it is not check.

I haved also tryed to pu some code but with no result. It seeams that it doesn't worck like the older versions. It give's me the falowing mesage "Permision Denied". Probably i did not put the code vhere it should be and i do not thinck that it is enought (i din not use true or false).

private Sub Section3_Format(byval pFormattingInfo as Object)
Raport8.DiscardSavedData
End Sub

I hope that you can help.|||Hi

How do I open the password protected .mdb when there is sub reports in the Crystal Report. I got it to work on reports which contains no subreports. The problem is with the ones thats got subreports. It crashes the calling program.

Bezzie|||how do i update my report
through vb|||hi,

Can you tell me what error message you got from provider when at run time.

yours,
Babu

MailID: k_babs@.hotmail.com|||hi,

"Discard Saved Data When Loading Reports" this should be always check, because At design time crystal report using by default same current data.

every time crystall can't refresh all data, because it's time consume

but, we don't need saved data at our run time. so, we should be check "Discard Saved Data When Loading Reports"

you can also set the value at run time at vb code.

yours,
Babu

MailID: k_babs@.hotmail.com|||hi,

i assume you need to update crystal report properties through by vb code.

if you had installed crystal report, open component dialog box check the crystal report control

insert the control from toolbor to form then update the available crystal report control properties.

yours,
Babu

MailID: k_babs@.hotmail.com|||how do i update it
can u provide me some code
thanx|||I understand you but thet problem was that the "Discard Saved Data When Loading Reports" doesn't stay check. I am checking it, saving my project but after i am running my aplication the "Discard Saved Data When Loading Reports" it is uncheck. Strange ?

I have also tryed with some code but it does not have any effect. I haved put my code at my report initialization "report.discardsaveddata" but no efect. Strange Again ?

I alsow tryed and put the same code into the buton that triegers the printing. No luck again.

Could this be a bug ?
Did i use the code right ?

I did not declared my report source trow code, could this help ? If so please send me a piece of source to understand how to do that.

Hope you can help because i am desperate.|||Hi Babu

The message I get is:

Run-time error '20535'
Error in file C:\VB Projects\Birds\History.rpt
Unable to connect: Incorrect session parameters.

I open the database file in the app with:
Set dbs = OpenDatabase("C:\VB Projects\Birds\Ringneck.mdb", False, False, ";pwd=mypassword")

I then call the report as follows:
CrptHistory.Destination = crptToWindow
CrptHistory.Formulas(0) = "blah blah blah" //26 of them
CrptHistory.LogonInfo(0) = "dsn=;uid=;pwd=mypassword;dsq="
CrptHistory.ReportFileName = "C:\VB Projects\Birds\History.rpt"
CrptHistory.Action = 1

Bezzie|||hi,

That formulas(0) value is incorrect.

First, you have to create formula in crystal report design time.

assume "myVar" is your formula variable

Then you pass the value to that variable like

CrptHistory.Formulas(0) = "myVar = 'Hello'"

yours,
Babu

MailID: k_babs@.hotmail.com|||Hello! I hope you can help me with this...

I have a DLL that shows the Print Preview screen of the Crystal Report. The problem is that the Preview screen just flashes and then disappears after a few seconds. I think this may be because the DLL "dies" after the ASP page calls it.

I tried creating a looping procedure with a timer that dictates the length of time that the preview screen should show. This works however, if the user presses the close button of the Preview Screen (top right of the screen), the screen refuses to close since the timer procedure continues to loop. I tried placing a wind_ClosePrintWindow event for the window that houses the report. However, it seems that the proram still finishes the looping before handling the close event.

I am out of ideas! Help! Thanks!|||i have an application made from vb6 that reads data from a text file and export it to an access table. Can i use crystal report designer version and design a report/graph reading from that table (FYI, the table will change its values everytime a different text file is read from).
and is it possible if i just save the report in a folder and execute the file independently by calling it from vb?
if you have a much more simple solution then please advice me on this. Really appreciate your time.|||hi,

Well, any how after you convert your text file to access table, the table will be a same name and same structure, in between conversion process, crystall report don't know what it happens, it's happen normal updates. you can use crystal report for graph no problem.

yes, it's possible you can save rpt file in your folder after you can call from vb.

yours,
Babu

MailID: k_babs@.hotmail.com|||hi,

Try use DoEvents statement, Don't use timer controls for the cause.

yours,
Babu

MailID: k_babs@.hotmail.com|||hi,

i can't get your actual requirement, can you send your testing code.

yours,
Babu

MailID: k_babs@.hotmail.com|||Som files might be in Read only mode.. Check for that.

Nicolas Bohemier
______________

Un sourire ne cote rien, mais il rapporte beaucoup; il enrichit celui qui le reoit sans appauvrir celui qui le donne.

Frank Irving Fletcher|||Hi Babu

That was just a typing error on my side. The Formulas is correct and working.

If the database is not password protected then the reports work fine. It's only when the database is password protected and I try to print the report that I get the error.

Bezzie|||I want to disply the recordset made from VB application to crystal report. How can I do it?|||It was really a major relief to see someone helping out in Crystal Reports (cr). Otherwise, hardly anyone knows cr properly in the industry today. The help that cr gives alongwith the software is also not elaborate enough.

I am right now developing an accounts package using VB6 as frontend, Access as backend and Crystal Report 8.5 Report Designer Component.

The points for clarification are as below:-
(1) If i am putting a password in my access database, and then designing some reports using 'Report Designer Component', it gives the following error when I am using ADO connection string to connect to the database and clicking on Test Connection - "Test Connection failed because of an error in intializing provider. Cannot start your application. The workgroup information file is missing or opened exclusively by another user". The Access database was not open when doing this. Provider name and other details that i am giving are all correct. Any solutions for this? Or is it that, i cannot set a password for Access database if i want reports in cr?

(2) Since the software is going to be a multiuser application, do you forsee any problem while installation. One problem i found out was setting the path for reports. I am using .dsr files. What i am doing is setting the location as under :
Report.Database.Table(1).Name = "xzy" ' table name which matches with actual design.
Report.Database.Table(1).Location= App.Path & "\database.mdb"
Are there any other alternatives to this? If am am hard coding the query itself in the RDC, will the above codes run? What should i write as table name then, since the query user multiple joins? Also what to do in case if i am giving password for my database.

(3) Is cr really powerful than Data Report of VB? Many people have told me that there are several problems like setting the paper size etc. in Data Report. Apart from that are there any other problems?

Thanking you.|||It was really a major relief to see someone helping out in Crystal Reports (cr). Otherwise, hardly anyone knows cr properly in the industry today. The help that cr gives alongwith the software is also not elaborate enough.

I am right now developing an accounts package using VB6 as frontend, Access as backend and Crystal Report 8.5 Report Designer Component.

The points for clarification are as below:-
(1) If i am putting a password in my access database, and then designing some reports using 'Report Designer Component', it gives the following error when I am using ADO connection string to connect to the database and clicking on Test Connection - "Test Connection failed because of an error in intializing provider. Cannot start your application. The workgroup information file is missing or opened exclusively by another user". The Access database was not open when doing this. Provider name and other details that i am giving are all correct. Any solutions for this? Or is it that, i cannot set a password for Access database if i want reports in cr?

(2) Since the software is going to be a multiuser application, do you forsee any problem while installation. One problem i found out was setting the path for reports. I am using .dsr files. What i am doing is setting the location as under :
Report.Database.Table(1).Name = "xzy" ' table name which matches with actual design.
Report.Database.Table(1).Location= App.Path & "\database.mdb"
Are there any other alternatives to this? If am am hard coding the query itself in the RDC, will the above codes run? What should i write as table name then, since the query user multiple joins? Also what to do in case if i am giving password for my database.

(3) Is cr really powerful than Data Report of VB? Many people have told me that there are several problems like setting the paper size etc. in Data Report. Apart from that are there any other problems?

Thanking you.|||If you have time and will, you should write an article about Crystal Report usage: these are valuable informations for all of us. Mail to Brad Jones (the moderator), to know how to do.

Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Michael
and all the other wonderful people who made and make dev-archive a great place.
Come back soon, you Gurus.

The Rater|||Sorry but there are no Read only files.
Thanck you anyway|||My only code is:

private Sub Report_Initialize()
Report1.DiscardSavedData
End Sub

where Report1 is my report.
For testing i am introducing data into my form, refreshing my databese and printing my report.
The resoult: the data are not chenged.

I am begining to belive that it is not a programing error because Discard Saved Data When Loading Report doesn't stay check.|||Thanks! The DoEvents keyword really did the trick! =D

I have one last question. For example, I have this querystring:

SELECT * from TABLE where UserID = ' " & userid & " '

The question is how do you place the value of ' " & userid & " ' in the report?

Thanks!|||hi,

Set your recordset to DataSource Property in crystal report control.

yours,
Babu

MailID: k_babs@.hotmail.com|||hi,

Pass this 'userid' (variable) value to crystal report formula, using cr.formulas(0) property of crystal report control.

yours,
Babu

MailID: k_babs@.hotmail.com|||DiscardSavedData Property

If data is saved with the specified report, setting this property to 1 (True) discards the data.

cr.DiscardSavedData = True
(or)
cr.DiscardSavedData = 1

Discards the data saved with the specified report.

Thanks.

MailID: k_babs@.hotmail.com|||hi,

(1) if password set unable open database in crystal report.

Create new database, set the password, use the database in your project with crystal report.

Solution:
crCommon.LogonInfo(0)= "dsn=;uid=;pwd=MyPassword;dsq="
crCommon.DataFiles(0) = "C:\My Document\db.mdb"

feedback me, we will solve the next problem.

yours,
Babu

MailID: k_babs@.hotmail.com|||hi,

Make sure your sub report not using other database, if sub report using other database and set password, use the following code.

crCommon.LogonInfo(0) = "dsn=;uid=;pwd=Good1;dsq="
crCommon.DataFiles(0) = "C:\db1.mdb"
crCommon.LogonInfo(1) = "dsn=;uid=;pwd=Good2;dsq="
crCommon.DataFiles(1) = "C:\db2.mdb"

yours,
Babu

MailID: k_babs@.hotmail.com|||hi,

Thank you for you suggestion, Still i need to learn more in crystal report to develop well. That's why i try to help others, my level best.

Thanks,
Babu

MailID: k_babs@.hotmail.com|||Hi,

The program uses only one database with different tables. Some of the reports uses subreports with the same table only and others subreports that uses different tables but all the reports and subreports come out of the same .mdb database.

Bezzie|||I want the solution of the problem listed earlier but you did not replied me... pls read my question again and advice me something... thanx..

AITG|||hi,

Before using user defined function, you should understand sqlquery property, because sqlquery property changing support for FROM, WHERE, GROUP class only.

better you copy Select <fields> class from report design and paste at VB code, and test where class with simple condition like Name = 'Raja', if it's work good, then proceed with sqlquery property.

yours,
Babu

MailID: k_babs@.hotmail.com|||Hi babu,

Can u point me to some sample program, so that i can get a fair idea of using Crystal reports in VB.

Regards,
kiran.|||How can I display a report using 'CRViewer' control. I could able to show it using 'CrystalReport' control.

Regards,
kiran.|||hi,

Which version of crystal report you had.

Thanks.

MailID: k_babs@.hotmail.com|||Well i have a bit ancient version :)) of Crystal reports . The version is 4.5 and i use it with Visual basic 6.0|||How do i save the report generated to a file? I want to save it programatically.

How to send the report as an email?

Regards,
kiran.|||Hello Babu,

Good Morning,

U are doing a great job in solving the doubts of crystal, Hardly we find people knowing in depth of crystal. My sincere thanks to u.

The blank lines is left intentionally at the report footer, so that the printer moves say 5 or 6 lines above, so that the user can cut it off, very easily. But after cutting the paper, there will be 5 lines blank before the heading. This is used for example something like in a departmental stores( where they print continous stationery, as the print comes, they will tear it and give to customer).

And also, I do observe that generally crystal takes 4-6 secs on a average to send the data to the printer. Is there anyway, by which I can avoid the delay.

I would like to issue the print, only when the printer is online, how do I make sure this because, I am giving this

report.ExportOptions.FileName="c:\a.prn" report.export false

This is directly giving the output on to the printer if the printer is ON, otherwise, no error msg also.

And lastly, one more thing how do I make sure that the crystal report has exported the data 100% correctly ( It contains data, I mean if the conditions are not satisfied, then it prints the page header, and others without the actual data), I do not want to print this, when the condition is not satisfied.

I am sorry, if I am disturbing u too much.

Have a nice day.

Regards,

Shiv Kumar G.M.|||hi,

use RecordsPrinted property of crystal report this will return number of records to be printed.

yours,
Babu

MailID: k_babs@.hotmail.com|||Hi Babu,
I'm brand new in Crystal report, I was wonder if you could spend a little time to help me to create a report in VB using Crystal Report.
I have Visual Basic 6.0 and Crystal Report 6.0 installed in my computer.
I have create a report file called ex1.rpt,
but in my VB I can not file the Crystal Report compoent. so I don't know how to call my report file. CAn you help me?
thanks
Khin Lau|||hi,

In VB (Project menu - Components) check the crystal report control,

Drag the crystal control to your form and follow the code

cr.reportfilename = "myreport.rpt"
cr.action = 1

if you want more details mail me.

Thanks,
Babu

MailID: k_babs@.hotmail.com|||...Except K. Babu ;)...
If K. Babu helped you here, it is a good policy to rate his answers.
So, please, if you are concerned, go to the answer he gave you, and
scroll down page until you see on the right a combo and a commandButton
(with caption= "Rate it"). Select appropriate value from combo, then
click on button.

This is the way, here, to say "Thank you".
Regards to everyone,

Cesare Imperiali

Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Michael
and all the other wonderful people who made and make dev-archive a great place.
Come back soon, you Gurus.

The Rater|||hi,

Thank you, for your intrest regarding dev-archive website.

I said "Thank you" to you, by yours way.

K.Babu

MailID: k_babs@.hotmail.com|||hi,

Apply the following code to export file (text format) directly without prompt.

cr.Destination = 2 '(to file)
cr.PrintFileName = "myfile.txt"
cr.PrintFileType = 2 '(text format

yours,
Babu

MailID: k_babs@.hotmail.com|||Dear babu,

I am still using Crystal Reports 4.6. I would like to know what the later versions have to offer me before I invest money for it.

I appreciate your kindness to spend your valuable time for code guru users.

Kishore.|||hi,

The latest version of crystal report released 8.5, there are three editions. Developer,Professional,Standard

yours,
Babu

MailID: k_babs@.hotmail.com|||Can I change the positions of columns in a report at run time through VB.|||You can change crystal report column position using with RDC.

Babu

MailID: k_babs@.hotmail.com|||Hi,

I have a problem with the parameters passing.

Suppose you have a report that contains three sub reports. These sub reorts are linked to the main report columns. But the main report requires two string parameters to be passed.

How can I pass parameter values to the report. Currently I am using the Report.ReplaceSelectionFormula property to do but it is not the correct way to do things :-)

So Can you guide me on how to do it ?

Thanks,
Krogoth!

FSM|||Hi
How to custom export of cystal report?.
I want to export crystal report to new file format
same GIF,
Can you tell me format of crystal report files?.

Thank you very much!|||We are using VB6.0 and CR7.0 The problem with the help is that it lists like 5 files to redistribute with VB setup.

We know better than that. It doesn't allow full functionality like Group, Export, etc. without the other files when you print or preview. We have narrowed down to like 25 files to redistribute and it will provide full functionally. I don't know if it is a violation of CR but they don't do all functions.

So either CR is screwed up with their files or we did some wrong coding. Most of the files that we have added begin with U2*.DLL.

Can you help?|||hi,

You can export from Crystal report using with PrintFileType property, this property list supported format,

you can enter the file name in PrintFile Property.

and Destination property - To File.

MailID: k_babs@.hotmail.com|||hi,

I suggest Package Wizard, that will help you your problem.

Others no comments.

Babu

MailID: k_babs@.hotmail.com|||We are facing a bug in crystal report. I am printing a memo field (with RTF Format) in Crystal report 8.0 using VB/MS SQL 7.0.I am passing a ADO recordset to field data type ttx file. The reports are genearlly of 3-4 pages.In print preview it shows correctly but when i take out a printout,sometime first line of next page gets printed on previous page as well as on the next page also. So same line gets printed twice rather than once.
e.g

In preview
Page1: XYZ (Line 1)
......
AAA (Last Line)

Page2: ZZZZZ (Line 1)
.......
CCCC (last Line)

While printing
page1: XYZ (Line 1)
......
AAA
ZZZZZ (Last Line)

Page2: ZZZZZ (Line 1)
.......
CCCC (Last Line)

We have tried various printers but problem still persist.The problem is erratic & comes in 1-2 pages if report 5-6 page long.
Waiting for your reply.|||i want to call .rpt file from net that is on web page ,
is it possible if yes tell me how to do this

Regards
AbhiDesh|||For Testing,

Create new crystal report file,
Add memo field only,
Set memo max to 10 lines.

Test the report file with printers, feedback to me

Babu

MailID: k_babs@.hotmail.com|||My problem comes when report is of multiple pages & while the first line of next page gets printed on previous page also.

Regards|||Hi there - and congratulations on this thread - it's a credit to you.

If you could help me with this I'd appreciate it.

I'm attempting to pass two date parameter values to a report -more specifically, to each of three subreports over the url line.
I've tried prompt0=date(2001,11,01)&prompt1=D...etc

I've tried prompt0@.subreport1=Date(2001,11,1)&prompt1@.subreport1=Date(2001,11,30)&prompt..etc

I have the parameter fields unsuppressed and they are simply not picking up any values at all.

Do you have any relevant wisdom to share.

thanks man,

Surrendermonkey

Colon-Hyphen-Close-Bracket|||I need to printing one repport with many columns that don't fit in landscape orientantion, i need more than 1 page to print the report, how could i do to printing in multiple pages? this is in VB6 and the crystal reports that comes with in, version 4.6.1 think so.... thanks|||I was just wondering how to I pass a VB variable to crystal report ?? thanks.

HTH

cksiow
http://vblib.virtualave.net - share our codes|||Hi..
How can reduce time to dispaly a crystal report
I mean to saycan U explainbest possible ways toreduce time .I know it depends on
no of records UR where conditions in sql.and UR machine configuration etc.
but is there some other ways by which one can reduce time to display a report
Nagesh Patil|||Hi,
I'm using CR7.0 with VB6.0 and I have problems with the installation program and the libraries I have to join. When I install my soft in a PC without CR, reports don't display. I've just achieved show them, but they aren't able to connect to data base. I think that some DLL's are missing, but I can't found them. I don't know which ones are the libraries that I need to install. Although there is a DLL that program requires but that DLL doesn't exist: 'pdssql.dll'

Please HEEEEELP!!!!

Thanks a lot.

KokoLiso --> choripene@.hotmail.com|||i have find topics on RDC but i can't found much details.
Can u send me sample code for that to mail tpever2000@.yahoo.com
Thanks for your support.|||Hi there!
I hope you might be able to help me
Here's the problem:
I have a form in Access,with a list box and a command button in it.
I putted a Crystal activeX, named Crystal1.
I can set the reportname variable equal to list boxes' value, so if the user selects a report and presses the command button, hecan see the specified report. My problem is that I want to use parameters, BUT I don't want user to opens the report's parameter field. I want set parameter values from a combo box in the form.
I would appreciate any help.
Thanks a lot
brutus|||shiv kumar,

Can you send me a mail regarding, your previous crystal reports doubts, now i collecting overall general problem in crystal report for all programmers.

Thanks.

MailID: k_babs@.hotmail.com|||hi,

for example you want to print name = 'Raj'

' you should enter the single quote for string data type
cr.SelectionFormula = "{Employee.Name} = 'Raj'"

'you no need to enter single quote for numeric data type.
cr.SelectionFormula = "{Employee.RecNo} = 10001"

do your level best.
Babu

MailID: k_babs@.hotmail.com|||Hi,
I cannot see why i cannot see the report.
Private Sub Form_Load()

CRViewer1.EnableExportButton = True
Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
Set webSource = CreateObject("WebReportSource.WebReportSource")
webSource.ReportSource = webBroker
webSource.URL = "http://www.pay-ware.com/documents/Utilities-Install-guide.pdf"
'webSource.URL = "file:///C:\Documents and Settings\ishaikh\Desktop\Report2.rpt"
webSource.PromptOnRefresh = False

'webSource.AddParameter "user0"
CRViewer1.ReportSource = webSource
CRViewer1.ViewReport

End Sub

Please rate the article if it is of any use to you. This encourages me to reply more and more and more.|||Hello there.
I have a crystal report with several parameters. I want to pass a value to one of the paramters (or at least set the default value) but let the user enter the other parameters.

Any help will be appreciated.|||hi,

create formulas names in crystal report design time.

eg. EmpName
EmpDesignation

vbcode:

cr.formulas(0) = "EmpName = 'Babu'"
cr.formulas(1) = "EmpDesignation = 'Programmer'"

if you had input variables use bellow code:

cr.formulas(0) = "EmpName = '" & svEmpname & "'"

K.Babu|||Originally posted by stealbreeze
Hello there.
I have a crystal report with several parameters. I want to pass a value to one of the paramters (or at least set the default value) but let the user enter the other parameters.

Any help will be appreciated.

do you solve the problem?|||Hello,
Yes I was able to solve my problem. Thanks for your advice. I 'm sure to have more questions in the near future.

I have been using Crystal for a reporting tool for a few years. But I have just begun to incorporate it into VB programs.

Thanks
:cool:|||Is there any way to read the Item Values from the same section where i click.

Basically, I have a report which is grouped by a field in the recordset. I show also show a link which is an on demand subreport. Now when the user clicks on the subreport link i need to identify and read the Items in that section where he clicked as i need to do some processing for that item.

Any ideas would be of great help.
(Or any pointer to some good news groups about crystal reports can be better too.
PS: dev-archive guys, please don't get offended by this :), Its 'coz of my urgency. )

Thanks,
kiran.|||hi,

When user click the link, change the link font color.

after color changes, you can identify the link previously read or not read refer by color, then do process what you need.

K.Babu|||Thanks for your reply...

No.., the processing i was talking about is read the data in the section.

This is like i have some data displayed on the report that is group by a field and has a subreport link, something like 'Details' link. Now i have to send the data to the subreport so that i can display the details. I can use subreport links options.. to link the data in the main report to and display the subreport, but this doesn't work for me. The only option for me is to identify the record on which he is intrested in. So is there any way to read that data.

Eg: Record will be like this

Cust Name: somename
Age: xx

View Details

I need to show details for the cust name, i can't link custname from the main report to subreport, my reqirement doesn't permit that. Now when user clicks subreport i need to identify the cust name he is intrested in. If i can get that.... my problem is solved.
I have been trying to get that.. and iam successful in getting custname in the first page using the 'index' parameter in DrillOnSubreport event. But from the second page the 'index' start from 1 again.

so any ideas...

Thanks once again..
kiran.|||Hi Babu,

You indeed are doing a great job. :) Please help me solve this problem.

I am using Crystal report 6.0. I have a master table (Employee Master) and several detail tables (EmployeeEducationDetails, EmployeeQualificationDetail, EmployeeTrainingDetail etc). Now I want to prepare a report where I pass the Employee ID as parameter and the report should display, in a Resume format, all Employee Details.

Problem is : there is only one detail section on the report so how would I display data from all the different Detail tables (there are 4 such detail tables). I tried grouyping the data (By qualification etc) but that did not help. Will I have to use Sub-reports?|||Originally posted by K.Babu
hi,

create formulas names in crystal report design time.

eg. EmpName
EmpDesignation

vbcode:

cr.formulas(0) = "EmpName = 'Babu'"
cr.formulas(1) = "EmpDesignation = 'Programmer'"

if you had input variables use bellow code:

cr.formulas(0) = "EmpName = '" & svEmpname & "'"

K.Babu

K.Babu,
Your solution (using 'formula' fields) works for passing values to show in the crystal report. How do I pass values to represent the 'parameter' fields that the report is using in the selection criteria?
I have a crystal report with 'parameter' fields for the date range that the report is using in the selection criteria. I want to bypass the default form for using input of the parameters, and use a custom form for the user to pass 'parameter' values to the report to be run.

Any suggestions?

Thanks,
SB|||cr_Report.Database.SetDataSource rs_Report

Using that line returns the entire contents of the query table instead of
the items in the query.

If I assign the recordset to an array the array contains ONLY the items I
requested but when I assign the same recordset to the crystal report it contains
ALL the items in the table.

Any help would be greatly appreciated.

Thanks,

Mike|||try giving some stars here...;)|||Hi,

I have a more CR rquestion not really relating to VB.
Do you know what the maximum number of detail sections/sub-sections we are allowed in a report?
I heard something about 622 sections... but not sure.

TIA

Cheers,
Laurent|||Hi,
In VB, how do you specify the datasource for a subreport in Crystal?

For example, I use the following code to specify the datasource for the Crystal report:
CrystalReport1.DataFiles(0) = strDataBaseName

I need to specify the datasource (same database) for the subreport within this same Crystal report.

Any help will be appreciated.

Regards,
SB|||hi,

Try this.

CrystalReport1.DataFiles(0) = strDataBaseName
CrystalReport1.DataFiles(1) = strDataBaseNameNext

Babu|||Hi,
I tried your code:

CrystalReport1.DataFiles(0) = gDataBaseName
CrystalReport1.DataFiles(1) = gDataBaseName 'It is the same DB as the Main Report

I get the following error:

--------
Seagate Crystal Reports: Database Error
--------
Error opening file.

File could not be found: "TransLog", at file location: "TransLog"
--------
OK
--------

"TransLog" is the name of the table in the DB that the Subreport is using.

Any other suggestions?

Thanks
SB|||hi

don't use same database once again, if you want to open more the one database, use 0 index for first database, use 1 index for second database.

make sure your database path is correct

if your database is placed in your exe directory you may use the following e.g. code

gDataBaseNameSecond = App.path & "\Inventory.mdb"

CrystalReport1.DataFiles(0) = gDataBaseNameFirst
CrystalReport1.DataFiles(1) = gDataBaseNameSecond|||Hi Babu,
I tried your suggestion and I still get the same error. The report will work on my machine as the db location is the same as when I set up the report / subreport in Crystal.

I wanted to change the location at run time, as I do for my other reports using app.path. That way I do not need to know where the db is on the user's pc.

I found this on Crystal's web site, but have not been able to work through it yet.

http://support.crystaldecisions.com/library/kbase/articles/c2002360.asp

I was hoping there was an easier way to do it.

Thanks,
SB|||hi,

You may also test sub report working alone, without any main reports.

For testing.|||Dear All,

Some people mailed at my personal mail, and they asked me to send my photo, so i upload my photo at dev-archive web site with the size of 50 x 50 pxls.

Yours Babu|||Hi Babu,
That's a great job done. Just an unsolicited advice, while posting reply please do address the answer to the member who posted it like : Dear debuchakrabarty, if I had posted it. Since the thread is collosal now, it would let the member locate his answer easily. More easy would be to reply to the particular post in which case s/he gets to know about it thru email.

:)
Hats off to you!|||is it possible to use crystal report for a flat file . if so give example|||Can I populate a blank Crystal Report with labels, graphics, textboxes and data at runtime ?|||Hi, Babu

I have a problem with the parameters passing when I use Sub Report.

Suppose I have a report that contains a sub report. The sub reorts has the same parameters with Main Report. I want to pass the parameters from VC code to the reports, but I don't know how to pass the parameters to sub reports

Can you guide me on how to do it?

Thanx first.|||Hi Babu,

(1) I would like to load a picture file (eg. JPEG) in Crystal Report. However, my data is in SQL DB. The picture data field is actually the file location (ie. string data type) on my hard disk. Is there a way to solve this?

(2) I know I can do it if I store my picture file as binary image data type in SQL DB instead of just a file name.

(3) And if I have to resort to (2), do u have any sample code about reading and writing a image file into SQL DB?

Thanks,
LingLee|||Is BABU still around :confused:|||Hi

i am facing problems printing the report in visual basic.
i am using the crystalreport ocx to print report to the window.

just as it is printing to window the window closes. i am not able to get any errors also.

i tried setting the properties through codes yet the result is same

CrystalReport2.ReportFileName = App.Path & "\Report.rpt"

CrystalReport2.Destination = crptToWindow

CrystalReport2.Action = 1

can you tell me is there any settings .i have used the similar way for other reports but is fine.

thanks
roopa|||hi,

Make sure your default printer is currectly installed, if it's work fine with other software like MSWord.

Then open the crystal report design environment select the printer setup reselect the printer, if you had more than two printer driver change the other printer driver and try again.

yours,
Babu|||Sorry for confusion i am trying to view the report in the window.
i can see the report coming up but suddenly it closes. Sometimes it never even open up.
Can it be because of my installation.only few days back i installed and my previous reports if i save it using the recent version is also giving the same problem which was fine previously until i saved it.

thanks
roopa|||I'm using SQL Server as database server and VB as a programming language. I need to know how can I make a report in CR with datasource as stored procedure (with parameters). I need to send the parameter from VB to CR and the the CR to send the parameter to the stored procedure. Thanks|||hi,

Uninstall Crystal Report which is installed last, make sure the Crystal Report uninstall properly. Then reinstall the crystal report and then try again to view the reports.

yours,
Babu

Originally posted by sing12
Sorry for confusion i am trying to view the report in the window.
i can see the report coming up but suddenly it closes. Sometimes it never even open up.
Can it be because of my installation.only few days back i installed and my previous reports if i save it using the recent version is also giving the same problem which was fine previously until i saved it.

thanks
roopa|||Originally posted by valentindvf
I'm using SQL Server as database server and VB as a programming language. I need to know how can I make a report in CR with datasource as stored procedure (with parameters). I need to send the parameter from VB to CR and the the CR to send the parameter to the stored procedure. Thanks

hi,

Which version of crystal Report you are using? Because the all version of crystal report not support stored procedure.

yours,
Babu|||i am still unable to see the report it closes without any error

thanks
roopa

QUOTE]Originally posted by K.Babu
hi,

Uninstall Crystal Report which is installed last, make sure the Crystal Report uninstall properly. Then reinstall the crystal report and then try again to view the reports.

yours,
Babu

[/QUOTE]|||The report and program working on another system not on my system. What may be wrong.

i reinstalled crystal reports.it is something with my vb?
i am not able to configure what is wrong.

thanks
roopa

Originally posted by sing12
i am still unable to see the report it closes without any error

thanks
roopa

QUOTE]Originally posted by K.Babu
hi,

Uninstall Crystal Report which is installed last, make sure the Crystal Report uninstall properly. Then reinstall the crystal report and then try again to view the reports.

yours,
Babu

[/QUOTE]|||Create simple crystal report file, call the file in vb, if it's working fine the problem may be some others.

yours,
Babu

Originally posted by sing12
The report and program working on another system not on my system. What may be wrong.

i reinstalled crystal reports.it is something with my vb?
i am not able to configure what is wrong.

thanks
roopa

[/QUOTE]|||i have tried that also none of them are working all comes up and closes immediately.
thanks
roopa

Originally posted by K.Babu
Create simple crystal report file, call the file in vb, if it's working fine the problem may be some others.

yours,
Babu

[/QUOTE]|||Are you Confirm your condition matches the records in data.

Originally posted by sing12
i have tried that also none of them are working all comes up and closes immediately.
thanks
roopa

[/QUOTE]|||dear babu,

i am using vb.net and sql server and crystal reports

i did all reports outside .net and i want to show the reports and selectin formula in browser

what r the steps to show report in browser without enabling savewithdata option

phani|||hi
i am confirmed the records match since the report is seen in the report designer without any problem
But now within 2 days i have to solve it.
this time i tried in another system also still does not work(completely new did installation from scratch)

any other suggestions?

thanks

roopa

Originally posted by K.Babu
Are you Confirm your condition matches the records in data.

[/QUOTE]|||Hi Badu, we have licensed Crystal 8.5 Enterprise , we developed
embedded Reports (dsr) with Visual Basic 6.0 SP5.

But we are not able to distribute it , we built a setup
routine with the Setup Factory tool from indigo rose
(great tool) .

After installing on a new machine everything works ,
but when it comes to the reports

-> bang , 713 error active X Object can not be activated.

We have to install the full Version on that machine then
it works . is it a license Problem ?

can you help ?|||Most of the developers mailed me, setup wizard unable to prepare installation files, because of crystal report, they had licensed version of crystal reports.

You need to edit your setup wizard (or) other third party setup tool

Find out crystal report related files and add at setup wizard manually (depends the usage of crystal report).

for more information refer crystal report distribute fies from documentation.

Babu

Originally posted by bobiermann
Hi Badu, we have licensed Crystal 8.5 Enterprise , we developed
embedded Reports (dsr) with Visual Basic 6.0 SP5.

But we are not able to distribute it , we built a setup
routine with the Setup Factory tool from indigo rose
(great tool) .

After installing on a new machine everything works ,
but when it comes to the reports

-> bang , 713 error active X Object can not be activated.

We have to install the full Version on that machine then
it works . is it a license Problem ?

can you help ?|||Hi Babu,

Someone has also encountered the same problem with me. The image quality is very poor when we include a BLOB object in the report.

I notice that the same image (if I happen to enlarge the size of it on the design part in details section of Crystal Report) has better and in fact excellant quality if I make it the size of about 1/2 A4 paper.

We also tried doing this using VB. No problem with the image quality.

Did u, or anyone in the forum, has any idea about this? Need some advice.

Thanks.|||Hi,

Try to change the picture some other format like .jpg .gif .tif, this will solve your problem.

yours,
Babu

Originally posted by alfee5
Hi Babu,

Someone has also encountered the same problem with me. The image quality is very poor when we include a BLOB object in the report.

I notice that the same image (if I happen to enlarge the size of it on the design part in details section of Crystal Report) has better and in fact excellant quality if I make it the size of about 1/2 A4 paper.

We also tried doing this using VB. No problem with the image quality.

Did u, or anyone in the forum, has any idea about this? Need some advice.

Thanks.|||Hi, Babu

I was "forced" to use BLOB instead of jpeg, gif, etc.

Initially I was storing only the the .jpeg file location in my SQL database. However, when I designed my report, I can't drag the data field of my image file location to the detailed section in the report. Else, during run time, the report won't show my image!!

If I design using the picture box, I need to specify the image file name at the very beginning. But I have different image to show during run time for each record in the SQL database.

So I just want to confirm with you is it because of BLOB, the quality of image becomes so bad??

Is there any other way to solve my problem? Bearing in mind that I need to store my image file location (or it can be BLOB object, i don't really care) in SQL DB. Actually I have tried to write a .jpeg file to BLOB object in SQL DB and then read the BLOB object out from SQL DB back to .jpeg file. I find no data loss as the file size still the same, and the .jpeg image still looks like original.

Thanks.|||You have two options - make the pic box the same size as the original jpeg size, or,
decrease the size of the jpeg to the size of your pic box BEFORE you store it away as blob/file name.

The problem is caused by the pic box not resizing the image correctly.|||Actually I tried that before, using Photoshop to reduce the image size before storing into SQL DB. And my picture box in the crystal report is sized to about that of my image. However, I still get the same poor quality of image.

Another thing to check with you all..................

Anyone uses Crystal report and integrate with web? Meaning that I am accessing the report through web using some asp codes.

I am able to do that from machines that have win2K server on it.
I was prompted to install some Crystal Active X stuffs before the viewing of the report through our work place domain.

However, on other machines with Windows 2000 Professional or XP, I won't get prompted to install the ActiveX stuffs, and my report won't be able to view.

May I know what can I do? or where is the viewer active X stuffs for me to install on those win2K Pro machines?

Thanks a lot in advance.|||Hi Babu,

I am using Crystal Report 8.0 and VC++. I am forced to used foxpro data files. I have to display image which stored in general field, they are in JPEG binary format. Could you show me how to do that, please ?. Is it possible to implement user define functions to perform data manipulation, most UFL samples show date or string manupulation ?.

Regards,
Attawee:)|||How the Runtime Databinding is done in Crystal Report?
Like in Data Report we are using Recordset for assigning values, or we are using Dataenvironment? It would be more helpful if you can give a small code related to it.

And how can we group the related data in it?

Another Question,

Can we Stop the Crystal Report printing in between after printing some specific lines of data. Like we are using Kill doc in VB Printer Object. Or can we specify/change the length and width of the page. I will be grateful if you can provide small code for it..

Thanking you|||hi

i am facing problem refreshing data from the database using crviewer.

the report with database db1 is created with save data with report unchecked.

in vb during runtime i set the database to the user selected database(which has the same stucture as the db1) using Adodb.
the recordset does retrive all the data but
the data never refreshes only the field names which was originally there in the report is showed.

no errors.i am stuck with this problem

help please
roopa|||Hi Babu,
Do you know how to connect to an Access 97 db with db level password using the Crystal RDC?

I am able to connect for other Crystal reports using just the CrystalReport viewer.

Any input would be appreciated. As always, thanks for your help.

Regards,
SB|||Babu,
Never mind my question - I figured it out. Just in case you were interested this seems to work:

crpReport.Database.Tables(1).SetSessionInfo "", Chr(10) & "password"

SB|||Hi K. Babu,
1)Does Crystal Reports for .NET contain all features as Crystal Reports 8.0 or 9.0 does ? I mean : support for SQL DB stored pictures display etc...
2)Is it possible to configure on run-time the Data source of my report, not only to change the LogOnInfo ? If so, how can I do that ?
Thanks.|||Sorry, I could not serve all developers doubts for long time, because of my busy work.

Now, Iam little relax|||Im trying to connect to Pervasive SQL data base. The report works fine except when I try to access it thru VB. I am also trying to use the CRviewer in VB. I can use this all just fine when using SQL and our normal databases. But now Im trying to create some reports for other departments. My code...

Dim CrxApp As New CRAXDRT.Application
Dim CrxRpt As CRAXDRT.Report

Private Sub Form_Load()
Dim rptfile As String

rptfile = "C:\CrystalReports\test5.rpt"
Set CrxRpt = CrxApp.OpenReport(rptfile)
CrxRpt.Database.LogOnServer "PDSODBC.DLL", "10.0.0.34", "DATABASE", "USERID", "PASSWORD"

CRViewer1.ReportSource = CrxRpt
CRViewer1.ViewReport
end sub

--

The error I get is. "Server has not yet been Opened"

Is there a way to set this UserId and password in the report itself? or have I just got something wrong in the Logonserver line? Im totaly confused.|||hi,

Try to set server username & password in direct ODBC DSN, which is available in coltrol panel.

Then we will go for next step.

Thanks
K.Babu

Originally posted by JimB
Im trying to connect to Pervasive SQL data base. The report works fine except when I try to access it thru VB. I am also trying to use the CRviewer in VB. I can use this all just fine when using SQL and our normal databases. But now Im trying to create some reports for other departments. My code...

Dim CrxApp As New CRAXDRT.Application
Dim CrxRpt As CRAXDRT.Report

Private Sub Form_Load()
Dim rptfile As String

rptfile = "C:\CrystalReports\test5.rpt"
Set CrxRpt = CrxApp.OpenReport(rptfile)
CrxRpt.Database.LogOnServer "PDSODBC.DLL", "10.0.0.34", "DATABASE", "USERID", "PASSWORD"

CRViewer1.ReportSource = CrxRpt
CRViewer1.ViewReport
end sub

--

The error I get is. "Server has not yet been Opened"

Is there a way to set this UserId and password in the report itself? or have I just got something wrong in the Logonserver line? Im totaly confused.|||Thanks for suggestion. I tried setting Username and Password in Control Panel and am getting the same exact error. I did a little research and found that others are having the same problem with LogonServer.

Info at : http://support.crystaldecisions.com/library/kbase/articles/c2006666.asp

Sadly, thier suggestion of using this code instead :
Report.Database.Tables(1).SetLogOnInfo "server", "database", "UID", "PWD"
does not work either.

Our next attempt today is going to be to install CR and VB on the server and see if we can access and call it from there. I have my doubts about this as well, but at this point am willing to try.|||Try first simple reports, and then step by step we will move all kind of reports.

K.Babu

Originally posted by JimB
Thanks for suggestion. I tried setting Username and Password in Control Panel and am getting the same exact error. I did a little research and found that others are having the same problem with LogonServer.

Info at : http://support.crystaldecisions.com/library/kbase/articles/c2006666.asp

Sadly, thier suggestion of using this code instead :
Report.Database.Tables(1).SetLogOnInfo "server", "database", "UID", "PWD"
does not work either.

Our next attempt today is going to be to install CR and VB on the server and see if we can access and call it from there. I have my doubts about this as well, but at this point am willing to try.|||The report we are trying to use is as about as simple as it gets. Just one file involved and only 5 fields.

What is weird is that I can access the file in VB thru data Environment, and even put fields in a listview.

I can also print the report and access all the data from Cystal reports developer no problem.

I can print any other report from all our other databases (we have several) that is NOT pervasive.

The only problem is when I try to access that particular report from VB.

I dont know what the solution is. I would be happy if it would let me access data even by inputting a password each time.

I was hoping there was a way to save the password info in the report itself, but I cant figure it out.

So far, we have had no success with VB and CR on the server either. Strange.

Thanks for you help...|||use logoninfo without pwd and uid, if field is empty, it will prompt user name and password at run time.

K.Babu

crCommon.LogonInfo(0) = "dsn=;uid=;pwd=chennai_;dsq="

Originally posted by JimB
The report we are trying to use is as about as simple as it gets. Just one file involved and only 5 fields.

What is weird is that I can access the file in VB thru data Environment, and even put fields in a listview.

I can also print the report and access all the data from Cystal reports developer no problem.

I can print any other report from all our other databases (we have several) that is NOT pervasive.

The only problem is when I try to access that particular report from VB.

I dont know what the solution is. I would be happy if it would let me access data even by inputting a password each time.

I was hoping there was a way to save the password info in the report itself, but I cant figure it out.

So far, we have had no success with VB and CR on the server either. Strange.

Thanks for you help...|||Hi.

I have a problems with closing reports during run-time using Crystal Report Designer Component (RDC) from
Crystal Repotrs 8.5 with Visual C++ 6.0. In spite of I'm using VC++, the problem is not VC-related, so I will be glad even if you will show me how to do this in VB. I have the following member variables defined in my appilication CWinApp-derived
class:

IApplicationPtr m_pApplication;
IReportPtr m_pReport;
IFieldObjectPtr m_pobjDetail[3]; // fields pointers array for three objects
ITextObjectPtr m_pobjHeader[3]; // text pointers array for three objects
ITextObjectPtr m_pobjFooter; // fields pointer for report footer
CCrystalReportViewer4* m_pCryst;
CAdodc m_ctlADODC; // Microsoft ADO Data Control

At application startup I'm initializing m_pApplication and creating CCrystalReportViewer4 object:

...

m_pApplication.CreateInstance("CrystalRuntime.Application");
m_pCryst=new CCrystalReportViewer4;

...

After that I'm creating ADO Data Control window. When user selects a new database, I'm setting new
ADO record source and creating new report during run-time at the following manner:

ISectionPtr pSection,pHeaderSection,pFooterSection;
ISectionPtr pGroupSection;

...

// get reference to my ADO recordset
CAdodc& refADO=m_ctlADODC;
C_Recordset& rc=refADO.GetRecordset();

// creating a new report (***)
m_pReport=m_pApplication->NewReport();

// add database to a report (THE REASON OF MY HEADACHE)
m_pReport->Database->Tables->Add("",vTemp,_variant_t((IDispatch *)rc.m_lpDispatch,true),vTemp,"p2smon.dll");

// get the Detail section using "D" and Header section using "PH" as the index
pSection=m_pReport->Sections->GetItem("D");
pHeaderSection=m_pReport->Sections->GetItem("PH");
pFooterSection=m_pReport->Sections->GetItem("PF");

// add data to the report's Header section
m_pobjHeader[0]=pHeaderSection->AddTextObject("Field1",400,0);
m_pobjHeader[1]=pHeaderSection->AddTextObject("Field2",1100,0);
m_pobjHeader[2]=pHeaderSection->AddTextObject("Field3",2900,0);

// add data to the report's Detail section
m_pobjDetail[0]=pSection->AddFieldObject("{ado.Field1}",400,0);
m_pobjDetail[1]=pSection->AddFieldObject("{ado.Field2}",1100,0);
m_pobjDetail[2]=pSection->AddFieldObject("{ado.Field3}",2900,0);

// add data to the report's Footer section
_bstr_t bstrMessage("My report footer");
m_pobjFooter=pFooterSection->AddTextObject(bstrMessage,0,0);
::SysFreeString(bstrMessage);

// pass the report to the viewer and preview the report
m_pCryst->SetReportSource(NULL);
m_pCryst->SetReportSource(m_pReport);
m_pCryst->Zoom(100);
m_pCryst->ViewReport();

...

Above code works fine and I can see a valid report.
When user closes current database, I'm trying to close ADO recordset and report:

C_Recordset& rc=m_ctlADODC.GetRecordset();
if (rc.m_lpDispatch!=NULL) rc.Close(); // close recordset if it wasn't closed previously

// destroy footer since it doesn't refresh
pSection=m_pReport->Sections->GetItem("D");
pHeaderSection=m_pReport->Sections->GetItem("PH");
pFooterSection=m_pReport->Sections->GetItem("PF");
for (int j=0;j<3;j++) {
if (m_pobjHeader[j]!=NULL) pHeaderSection->DeleteObject(_variant_t(& *m_pobjHeader[j]));
if (m_pobjDetail[j]!=NULL) pSection->DeleteObject(_variant_t(& *m_pobjDetail[j]));
m_pobjHeader[j]=NULL; m_pobjDetail[j]=NULL;
}
if (m_pobjFooter!=NULL) pFooterSection->DeleteObject(_variant_t(& *m_pobjFooter));
m_pobjFooter=NULL;

// destroy report data
j=m_pReport->Database->Tables->GetCount();
while (j) {
m_pReport->Database->Tables->Delete(j);
j--;
}
m_pCryst->SetReportSource(NULL);
m_pCryst->DestroyWindow();
m_pReport->Release(); // HERE IS I'V GOT AN ERROR. HOW CAN I CLOSE OR
m_pReport=NULL; // DISCONNECT REPORT FROM ADO RECORDSET PROPERLY
// TO PREVENT DATABASE FROM STAYING LOCKED?

When I comment the last string ("m_pReport=NULL;"), the database stay locked and the error appear
during recreating report at line commented with "***" ("m_pReport=m_pApplication->NewReport();").
Could anybody advise how can I destroy created report properly (since there is no such method as
CloseReport at IApplicationPtr, or related method) to reuse the m_pReport for the next report and
prevent database from staying locked? Thank you very much!

P.S. Where can I get entire documentation on Crystal Report Designer Component (RDC)?|||Close first crystal report after that close recordset and then close tables

example:

({[...]}) first open last close, second open second close, last open first close.

Try this sequence, that may slove your problem.

yours
K.Babu

Originally posted by demask
Hi.

I have a problems with closing reports during run-time using Crystal Report Designer Component (RDC) from
Crystal Repotrs 8.5 with Visual C++ 6.0. In spite of I'm using VC++, the problem is not VC-related, so I will be glad even if you will show me how to do this in VB. I have the following member variables defined in my appilication CWinApp-derived
class:

IApplicationPtr m_pApplication;
IReportPtr m_pReport;
IFieldObjectPtr m_pobjDetail[3]; // fields pointers array for three objects
ITextObjectPtr m_pobjHeader[3]; // text pointers array for three objects
ITextObjectPtr m_pobjFooter; // fields pointer for report footer
CCrystalReportViewer4* m_pCryst;
CAdodc m_ctlADODC; // Microsoft ADO Data Control

At application startup I'm initializing m_pApplication and creating CCrystalReportViewer4 object:

...

m_pApplication.CreateInstance("CrystalRuntime.Application");
m_pCryst=new CCrystalReportViewer4;

...

After that I'm creating ADO Data Control window. When user selects a new database, I'm setting new
ADO record source and creating new report during run-time at the following manner:

ISectionPtr pSection,pHeaderSection,pFooterSection;
ISectionPtr pGroupSection;

...

// get reference to my ADO recordset
CAdodc& refADO=m_ctlADODC;
C_Recordset& rc=refADO.GetRecordset();

// creating a new report (***)
m_pReport=m_pApplication->NewReport();

// add database to a report (THE REASON OF MY HEADACHE)
m_pReport->Database->Tables->Add("",vTemp,_variant_t((IDispatch *)rc.m_lpDispatch,true),vTemp,"p2smon.dll");

// get the Detail section using "D" and Header section using "PH" as the index
pSection=m_pReport->Sections->GetItem("D");
pHeaderSection=m_pReport->Sections->GetItem("PH");
pFooterSection=m_pReport->Sections->GetItem("PF");

// add data to the report's Header section
m_pobjHeader[0]=pHeaderSection->AddTextObject("Field1",400,0);
m_pobjHeader[1]=pHeaderSection->AddTextObject("Field2",1100,0);
m_pobjHeader[2]=pHeaderSection->AddTextObject("Field3",2900,0);

// add data to the report's Detail section
m_pobjDetail[0]=pSection->AddFieldObject("{ado.Field1}",400,0);
m_pobjDetail[1]=pSection->AddFieldObject("{ado.Field2}",1100,0);
m_pobjDetail[2]=pSection->AddFieldObject("{ado.Field3}",2900,0);

// add data to the report's Footer section
_bstr_t bstrMessage("My report footer");
m_pobjFooter=pFooterSection->AddTextObject(bstrMessage,0,0);
::SysFreeString(bstrMessage);

// pass the report to the viewer and preview the report
m_pCryst->SetReportSource(NULL);
m_pCryst->SetReportSource(m_pReport);
m_pCryst->Zoom(100);
m_pCryst->ViewReport();

...

Above code works fine and I can see a valid report.
When user closes current database, I'm trying to close ADO recordset and report:

C_Recordset& rc=m_ctlADODC.GetRecordset();
if (rc.m_lpDispatch!=NULL) rc.Close(); // close recordset if it wasn't closed previously

// destroy footer since it doesn't refresh
pSection=m_pReport->Sections->GetItem("D");
pHeaderSection=m_pReport->Sections->GetItem("PH");
pFooterSection=m_pReport->Sections->GetItem("PF");
for (int j=0;j<3;j++) {
if (m_pobjHeader[j]!=NULL) pHeaderSection->DeleteObject(_variant_t(& *m_pobjHeader[j]));
if (m_pobjDetail[j]!=NULL) pSection->DeleteObject(_variant_t(& *m_pobjDetail[j]));
m_pobjHeader[j]=NULL; m_pobjDetail[j]=NULL;
}
if (m_pobjFooter!=NULL) pFooterSection->DeleteObject(_variant_t(& *m_pobjFooter));
m_pobjFooter=NULL;

// destroy report data
j=m_pReport->Database->Tables->GetCount();
while (j) {
m_pReport->Database->Tables->Delete(j);
j--;
}
m_pCryst->SetReportSource(NULL);
m_pCryst->DestroyWindow();
m_pReport->Release(); // HERE IS I'V GOT AN ERROR. HOW CAN I CLOSE OR
m_pReport=NULL; // DISCONNECT REPORT FROM ADO RECORDSET PROPERLY
// TO PREVENT DATABASE FROM STAYING LOCKED?

When I comment the last string ("m_pReport=NULL;"), the database stay locked and the error appear
during recreating report at line commented with "***" ("m_pReport=m_pApplication->NewReport();").
Could anybody advise how can I destroy created report properly (since there is no such method as
CloseReport at IApplicationPtr, or related method) to reuse the m_pReport for the next report and
prevent database from staying locked? Thank you very much!

P.S. Where can I get entire documentation on Crystal Report Designer Component (RDC)?|||Hi,

I need to design a report. Most of the data are from one dataset. There is one field that comes from outside this dataset. I don't want to use two datasources in the report or combining two datasets into one source. I am considering to use unbounded field for this data. And assign a value to it programmatically. But I can't find info on how to do it.

Could ponit direction for me? Is unbounded fiels a good solution for the case?

Thanks very much.

Glen Chen|||Hi,:

I am using crystal report visual studio.net, asp.net with c#. Crystal report creates a parameter field autmatically when I create a linked subreport. How do I retrive value of the parameter field from ASP.Net code ?

Thanks.|||hai babu,

i am using crystal reports 4.5. i want to pass a value from vb , which is the number records per page in crystal reports.

so how to?

thank u
sthota|||if you want to restrict number of lines per page, you don't need to pass the value from vb, you can set directly from crystal report design time, leave blank space at page footer group, this will reduce number of records per page.

yours,
Babu

Originally posted by sthota
hai babu,

i am using crystal reports 4.5. i want to pass a value from vb , which is the number records per page in crystal reports.

so how to?

thank u
sthota|||hai babu,

thank you very much for ur reply. but in my application user will select the number of lines per page. based on that i have to show report.

that is the problem. due to this, i cannot fix the report by increasing the page footer. so what should i do now?

thank u
sthota|||I have an image field in the database which stores text with its RTF.How can I show this column data in crystal report .Also I want to display it with its RTF.Please give me areply ,thanx|||Hi Babu advance thanks for UR help.

I am working on crystal reporter. I am basically a starter. My problem is

I want to create Crystal reports in VB with Access as a database.

I have to select certain fields from different database tables and display them in the report. Here the condition is I must select records of that pericular day(sys date basis). ie If I am creating a report today I have to select fields from the records I have added today.

And user will key in the date on which he wants the report from the keyboard(using textboxes).

Hope U understand my problem. If U need any other information pl let me know. As it is bit urgent, I await ur earliest reply.

Thank You very much for UR help

Cheers and Regards
Ram|||Hi Babu,

I am new to crystal reports and want to get started on it. could you please suggest me how to gain access some good documentation on crystal reports.

Thanks & Regards,
bikash|||Dear Babu

I have made a project for which i need to set page size of 7.5''x8''
with printer driver not supporting this size(note that my printer is DMP.) Is there any way to explicitly define the page size for output.

Regards

Shashi bhushan|||I have crystal reports available which are desgined in CR7.0 & sql server for my client server application.
I was passing query and formula fields from my application throught vb's exe.
All reports are created using report designer & with ODBC DSN for inserting views into report. now i am
upgarding same to web application using ASP & IIS.
Which is the best method to show reports in asp??
Changing sqlquery at runtime means using session("oRpt").SQLQueryString or should i use recordset?
i am attaching code for SQLQuery

<%@. LANGUAGE="VBSCRIPT" %>
<%
reportname = "SimpleSQLQuery1.rpt"
If Not IsObject (session("oApp")) Then
Set session("oApp") = Server.CreateObject("Crystal.CRPE.Application")
End If
Path = Request.ServerVariables("PATH_TRANSLATED")
While (Right(Path, 1) <> "\" And Len(Path) <> 0)
iLen = Len(Path) - 1
Path = Left(Path, iLen)
Wend
If IsObject(session("oRpt")) then
Set session("oRpt") = nothing
End if
Set session("oRpt") = session("oApp").OpenReport(path & reportname, 1)

// code to be written to connet to SQL Server

NewSQLQueryString = "Select Product_Master.Product_Name from Product_Master"
session("oRpt").SQLQueryString = cstr(NewSQLQueryString)
On Error Resume Next
session("oRpt").ReadRecords
If Err.Number <> 0 Then
Response.Write Err.description
Response.Write "An Error has occured on the server in attempting to access the data source"
Else
If IsObject(session("oPageEngine")) Then
set session("oPageEngine") = nothing
End If
set session("oPageEngine") = session("oRpt").PageEngine
End if
%>

Using above code i am getting following error ...

Error Type:
cpeaut32 (0x800A5077)
Cannot open SQL server.

How can i connect to SQL Server?? Should i use connectio open methos or logonServer & set logon info.?
i tried that also but getting same error. Should i take any special precaution while designing reports in
crystal designer??
I am using Crystal 7.0 , sqlserver 2000 (mix authorization ) & professional 2000 as my op. system.|||Dear K. Babu!

Thak you for the answer and sorry for my late reply. Could you show me how to correctly close crystal report and tables using RDC methods? Thanks a lot.

Originally posted by K.Babu
Close first crystal report after that close recordset and then close tables

example:

({[...]}) first open last close, second open second close, last open first close.

Try this sequence, that may slove your problem.

yours
K.Babu|||Do you know what' s the syntax of GETLICENSESTATUS method of the APPLICATION object in RDC?|||Mr Babu,

You are kind to help everyone! My question is simple, I have a variable that I would like to pass into a selection formula inside of Crystal Reports. On other words, I want to select only records in Crystal Reports 8.5 where the EntryID = gFindString.

gFindString is a value that is populated when a user selects a record using adodb.recordset.find.

Thanks in advance for the help!

Bob|||Refer the SectionLineHeight property

Originally posted by sthota
hai babu,

thank you very much for ur reply. but in my application user will select the number of lines per page. based on that i have to show report.

that is the problem. due to this, i cannot fix the report by increasing the page footer. so what should i do now?

thank u
sthota|||Is it possible to password protect reports?

- If so, how do you run them from VB with the password?

- If not, how do you keep the integrity of the reports after they are distributed to users?

Any suggestions will be appreciated.

Thanks,
SB|||i have parameter in my crystal report 8.5 and i want pass value from visual basic and without displaying parameter dialog
Thank you|||create formula field in crystal report design mode

named as MYNAME
and one more for BASIC

in VB code write

cr.formulas(0) = "Myname = 'Babu'"
cr.formulas(1) = "Basic = 10000"

Originally posted by fahedksa
i have parameter in my crystal report 8.5 and i want pass value from visual basic and without displaying parameter dialog
Thank you|||Hi,

Following is a description of the problem I am facing:

I need to create a report based on two DB tables. For eg, if the 2 tables are called 'x' and 'y'. both 'x' and 'y' have one common field and 'x' to 'y' is a one to many relationship. For eg let the following be the structure of the two tables:

table x table y
column names column names
------ ------
a c
b e
c f
d

I need to generate a report in the following format
x.a x.b x.c count(y.c) x.d
------------------

in the above report count(y.c) refers to the count of y.c for each x.c

I have tried the following code:

Form1.CrystalReport.SQLQuery =
"SELECT x.a, x.b, x.c, COUNT(y.c) AS Expr1, x.d FROM x , INNER JOIN y ON x.c = y.c GROUP BY x.a, x.b, x.c,x.d

Form1.CrystalReport.Destination = crptToWindow
Form1.CrystalReport.WindowState = crptMaximized
Form1.CrystalReport.Action = 0

normal execution of the query returns the right result set. but execution through crystal reports does not return the right result set.

your help would be appreciated.|||Hi,

Instead of 'Sqlquery', you can directly use query table to crystal report design mode. Try this.

yours,
Babu

Originally posted by bikashg
Hi,

Following is a description of the problem I am facing:

I need to create a report based on two DB tables. For eg, if the 2 tables are called 'x' and 'y'. both 'x' and 'y' have one common field and 'x' to 'y' is a one to many relationship. For eg let the following be the structure of the two tables:

table x table y
column names column names
------ ------
a c
b e
c f
d

I need to generate a report in the following format
x.a x.b x.c count(y.c) x.d
------------------

in the above report count(y.c) refers to the count of y.c for each x.c

I have tried the following code:

Form1.CrystalReport.SQLQuery =
"SELECT x.a, x.b, x.c, COUNT(y.c) AS Expr1, x.d FROM x , INNER JOIN y ON x.c = y.c GROUP BY x.a, x.b, x.c,x.d

Form1.CrystalReport.Destination = crptToWindow
Form1.CrystalReport.WindowState = crptMaximized
Form1.CrystalReport.Action = 0

normal execution of the query returns the right result set. but execution through crystal reports does not return the right result set.

your help would be appreciated.|||create formula field in crystal report design mode

named as MYNAME
and one more for BASIC

Pass Value to crystal report:
cr.formulas(0) = "Myname = 'Babu'"
cr.formulas(1) = "Basic = 10000"

filter condition:

crCand.SelectionFormula = "{mytable.EntryID} = 'abc'"
crCand.SelectionFormula = "{mytable.EntryID} = 123"

yours,
K.Babu

Originally posted by Delamater
Mr Babu,

You are kind to help everyone! My question is simple, I have a variable that I would like to pass into a selection formula inside of Crystal Reports. On other words, I want to select only records in Crystal Reports 8.5 where the EntryID = gFindString.

gFindString is a value that is populated when a user selects a record using adodb.recordset.find.

Thanks in advance for the help!

Bob|||hi,

Set 'Printer Setup' in crystal report design mode, you can change printer properties with custom paper size

yours,
K.Babu

Originally posted by shashibhushan
Dear Babu

I have made a project for which i need to set page size of 7.5''x8''
with printer driver not supporting this size(note that my printer is DMP.) Is there any way to explicitly define the page size for output.

Regards

Shashi bhushan|||Hi all this one is kind of weird,

I thought Crystal's run time licenses were free? Here is my code:

Set Appn = CreateObject("CrystalRunTime.Application")

Set cReport = Appn.OpenReport("D:\Programming Projects\Work Proposal\Take4\Reports\ViTriage.rpt")

Then if I add a watch value to cReport and expand the properties, I get a message box from Crystal that says that this api is not free and that I need to purchase it. I then get a:

"Error opening File

File could not be found in 'tblViHeader', at location 'tblViHeader'"

The file does exist at that location. Is this some type of weird legitimate error or is this because I do not have the correct version of craxdrt.dll or crviewer.dll. Or, is this because of my code?

What is weird is that the code that references tblViHeader comes a few lines down.

It was working and it just all of a sudden stopped.

Any ideas?

Thanks in advance!
Bob|||i wish to make a cube or olap (just like in cognos powerplay) in crystal 8.5. could you guys give some tips/ step by step procedure or any documentation will show me how to do it ?

thanks in advance|||Hi,

We have created a Visual C++ .NET program that uses Crystal Reports to export reports to files. The PDF files look great but, the EXCEL files force themselves into rows and columns.
When I use crystal to export the files to EXCEL I can get them to come out right when I choose
column width based on objects in the whole report from the Excel Format Options dialog box.
How do I do this programmatically?

Thanks
Gary|||Hello Mr K.Babu

I know how to design an report by Crystal Report but I do not know how to transfer database from Accscess to Crystal Report (I use Visual Basic and design Report by DataReport in VB6 but it can print Landscape orientation, that why I use Crystal report. )
Can you tell me how can i tranfer database from Access to Crystal Report .
Thanks a lot|||Hi, Mr. K. Babu:

I want to prepare a set of forms(PDF) from MDB database, could I load data from the database and fill in the field in the forms autumaticly by using Crystal Report ?

Thanks,

Mark,|||I want to create a report with the following in mind:

Table Layout
ProjectID | ComponentID | Stack | Level | Position
--------------------
10001 | 401 | 0 | 0 | 1
10001 | 402 | 0 | 0 | 3
10001 | 403 | 0 | 1 | 1
10001 | 404 | 0 | 1 | 1
10001 | 405 | 0 | 2 | 0
10001 | 406 | 0 | 2 | 1
10001 | 407 | 0 | 2 | 3
10001 | 408 | 0 | 2 | 4
10001 | 409 | 0 | 3 | 2
10001 | 410 | 1 | 0 | 1
10001 | 411 | 1 | 0 | 3

The Previous table should generate the following output:

Project ID: 10001
----------------------
409
405 406 407 408
403 404
401 402
______________________________
410 411
----------------------

I am using crystal reports version 7.0 professional. I cannot use the cross tabs to create this report because of limitations I found with it.

What I need to know, is given the table shown above, how can I position the Component on my report based on the Stack, Level, and Position fields of the records retrieved. The output must resemble that shown above.

I use C++, ADO, and MS Access is the database.

Mike B|||I think this is not a code error, reinstall yours crystal report again, make sure the related custom options are checked correctly.

yours,
k.Babu

Originally posted by Delamater
Hi all this one is kind of weird,

I thought Crystal's run time licenses were free? Here is my code:

Set Appn = CreateObject("CrystalRunTime.Application")

Set cReport = Appn.OpenReport("D:\Programming Projects\Work Proposal\Take4\Reports\ViTriage.rpt")

Then if I add a watch value to cReport and expand the properties, I get a message box from Crystal that says that this api is not free and that I need to purchase it. I then get a:

"Error opening File

File could not be found in 'tblViHeader', at location 'tblViHeader'"

The file does exist at that location. Is this some type of weird legitimate error or is this because I do not have the correct version of craxdrt.dll or crviewer.dll. Or, is this because of my code?

What is weird is that the code that references tblViHeader comes a few lines down.

It was working and it just all of a sudden stopped.

Any ideas?

Thanks in advance!
Bob|||Hi friends,

why do you need EXCEL format?, if your data like a word document, you can try export to some other format

yours,
K.Babu

Originally posted by ghoran
Hi,

We have created a Visual C++ .NET program that uses Crystal Reports to export reports to files. The PDF files look great but, the EXCEL files force themselves into rows and columns.
When I use crystal to export the files to EXCEL I can get them to come out right when I choose
column width based on objects in the whole report from the Excel Format Options dialog box.
How do I do this programmatically?

Thanks
Gary|||Hi friends,

Create cross tab query in access itself, then you can directly use the query in crystal reports design time.

yours,
k.Babu

Originally posted by MikeB
I want to create a report with the following in mind:

Table Layout
ProjectID | ComponentID | Stack | Level | Position
--------------------
10001 | 401 | 0 | 0 | 1
10001 | 402 | 0 | 0 | 3
10001 | 403 | 0 | 1 | 1
10001 | 404 | 0 | 1 | 1
10001 | 405 | 0 | 2 | 0
10001 | 406 | 0 | 2 | 1
10001 | 407 | 0 | 2 | 3
10001 | 408 | 0 | 2 | 4
10001 | 409 | 0 | 3 | 2
10001 | 410 | 1 | 0 | 1
10001 | 411 | 1 | 0 | 3

The Previous table should generate the following output:

Project ID: 10001
----------------------
409
405 406 407 408
403 404
401 402
______________________________
410 411
----------------------

I am using crystal reports version 7.0 professional. I cannot use the cross tabs to create this report because of limitations I found with it.

What I need to know, is given the table shown above, how can I position the Component on my report based on the Stack, Level, and Position fields of the records retrieved. The output must resemble that shown above.

I use C++, ADO, and MS Access is the database.

Mike B|||Babu,
I have Crystal Report Ver. 7.00 which runs very nice on Win 2000 but not on Win XP. I am sure Seagete are not stupid to this degree. Do you have a solution to keep it running on Win XP.|||What problem you face in XP OS, when using crystal report.

yours,
k.Babu

Originally posted by camelriding
Babu,
I have Crystal Report Ver. 7.00 which runs very nice on Win 2000 but not on Win XP. I am sure Seagete are not stupid to this degree. Do you have a solution to keep it running on Win XP.|||In design stage there is no problem. But at run time I get
(Method 'Action' of object 'CrystalCtl' failed)
Run-Time Error '-2147417848 (80010108)'

Thanks in advance|||If you can able to view print preview at design time, that it may be crystal report control problem, try after reinstall the crystal report

yours,
k.Babu

Originally posted by camelriding
In design stage there is no problem. But at run time I get
(Method 'Action' of object 'CrystalCtl' failed)
Run-Time Error '-2147417848 (80010108)'

Thanks in advance|||Babu,
Sorry about what I said in the previous message. In design time I get some errors. The current error I got today is:

CRPaige library CRPaige(32).DLL cannot be found.
It should be on the path.

I search all the hard disk for this file but it does not exist.|||To explain why we need to export to excel I need to explain our business app.

Our company is a multi media messaging company that delivers faxes, emails and voice messages around the world. Our customers submit jobs that deliver to as many as 600,000 recipients. Our reports have always been text. Since the business has grown we are now offerering graphical reports to our customers. These reports are delivered to them through email or into their mailbox.

We currently only offer pdf formatted reports to be sent to them. Our customers are directly asking us to pass the report back to them in EXCEL format.

The bottom line is that the report is formatted on a windows box and the file is then put on a server to later be delivered to the customer therefore, we need to pre-format the report before we pass it back to the server. The customer does not want to receive the file in another format and be forced to reformat it themselves.

Does this help you understand why I need to teach my VC program to programatically do this?

Thanks
Gary|||I thought that crystal report was not correctly installed or it may be corrupt in your machine, reinstall your crystal report once again.

Originally posted by camelriding
Babu,
Sorry about what I said in the previous message. In design time I get some errors. The current error I got today is:

CRPaige library CRPaige(32).DLL cannot be found.
It should be on the path.

I search all the hard disk for this file but it does not exist.|||Babu,
Thanks very much for your help. At the end I managed it by installing New Crystal Report V.8.5

Thnaks again|||I am puzzled.

I am looking at a report someone else created.

It looks simple to me.

There is a report head, group head, detail, group foot and report foot.

If the group selection causes a result set of no records, the variable fields in the report head are blank. The text fields there are filled in but, the data fields are empty.

If I right mouse on them in the designer and choose Browse field data I get good results.

I am reading from three different tables in a single database but, all the information in the report head is in one table.

Remember if there are records I do get a complete report.

Thanks
Gary|||hi,

Test the following steps:

Remove unwanted tables from report,
View the visual links are correctly,
Remark the filter condition in selection formula record or group,
Paste same field in different groups which is specified bellow by you, preview the result.

Originally posted by ghoran
I am puzzled.

I am looking at a report someone else created.

It looks simple to me.

There is a report head, group head, detail, group foot and report foot.

If the group selection causes a result set of no records, the variable fields in the report head are blank. The text fields there are filled in but, the data fields are empty.

If I right mouse on them in the designer and choose Browse field data I get good results.

I am reading from three different tables in a single database but, all the information in the report head is in one table.

Remember if there are records I do get a complete report.

Thanks
Gary|||Thanks but, this didn't work. I did get it to work but, please read on because I don't believe this was the best way. I have been a professional programmer since 1989 so I know the idea is that as long as it works don't complain but, I like to understand why.

I do want to say that I took out the grouping and simply had a detail line. I saw the same issue. If there are no detail records based on report / selection formula / records for the detail section then the report head details do not fill in. This doesn't make sense to me since the report head is populated from one xml element and the detail from another.

1. Remove unwanted tables from report
The input is actually an xml file. The xml file is populated from a Visual C++ app that uses OLE DB to connect to a UNIX sybase server and executes stored procedures there. The xml schema id is the entire dataset and each element represents a stored procedure. The report head of the report is populated from the information in one element and the body is populated by another element. This second element is repeated for each detail line.

2. View the visual links are correctly
I checked the links section. I changed the links around. I even removed any links from the record that contains the report head info. No change.

3. Remark the filter condition in selection formula record or group
If I do this all works well.

4. Paste same field in different groups which is specified bellow by you, preview the result
No change.

How I got it to work.
I now have a main report and a subreport.
The main report is the original report head and a new report head that simply contains the subreport.
The subreport is all the detail level information.

Now if the subreport contains no detail the main report fills in its detail. WORKS!!!

Thanks for your time
Gary|||I still need an answer to this one.

Is there another Forum I should post this to.

I realize that I am in a subForum of Visual Basic and this is a Visual C++ question.|||Hi Babu (or anyone who have an answer to this questions)!

I have 2 Crystal Report questions.

1. And old question... When I run the "Package and Deployment Wizard" all the DLL:s needed to run CR is not included (As an example: the ones needed when exporting to PDF-format in the CRViewer), do you have any good url (or maybee file on the Installation CD) where it's explained what DLL:s that are needed to be included in the Setup?

2. Is it possible in some way assigning a global connectionobject in the VB project to a report (and in that way telling it what database to work with)

I use VB6 SP5 and CR 8.5|||Sorry for asking on this forum. Nobody answers my question anywhere else. Maybe here?....
Does report with grouping require different code in VB.NET application with CrystalReportViewer Control than report without Grouping. I have several reports without Grouping and all of them are displayed just fine in both Crystal environment and in VB.NET app. Set of other reports are previewed fine in Crystal Reports environment, but give me a mess when I run them the same way as I do with reports without Grouping from VB.NET app.
What's wrong? Is this Viewer bug or I need to run report with grouping differently. In VB6 I did the same with any report.
Vlad|||Hello Mr. Babu,

I want to know, is there any way with which I can get the formula fields created in crystal report?

Amit Khardenavis|||Sorry
one change in my question. I want ot know the name of formula fields.

Amit khardenavis|||Create formula fields under insert menu at crystal report design time
eg. forName
forBasic

In VB Code

cr.formulas(0) = "forName = 'Amit'"
cr.formulas(1) = "forBasic = 20000"
... and so on.

yours,
k.Babu

Originally posted by akhardenavis
Sorry
one change in my question. I want ot know the name of formula fields.

Amit khardenavis|||Refer Distribution files in crystal report documents file.

Originally posted by stickan
Hi Babu (or anyone who have an answer to this questions)!

I have 2 Crystal Report questions.

1. And old question... When I run the "Package and Deployment Wizard" all the DLL:s needed to run CR is not included (As an example: the ones needed when exporting to PDF-format in the CRViewer), do you have any good url (or maybee file on the Installation CD) where it's explained what DLL:s that are needed to be included in the Setup?

2. Is it possible in some way assigning a global connectionobject in the VB project to a report (and in that way telling it what database to work with)

I use VB6 SP5 and CR 8.5|||Hello Babu,

I think I have not enterprited my question properly to you. My problem is,

I have created one report in version 8.0. In that I have defined some formula fields and record selection formula. Now From VB programme I am calling that report file. The data file is password protected MDB file. I am giving password to data file as per your suggesion. Then I am specifying the formula field values. but I am gettign one error message when I am trying to activate report. the error message is as per follows

Error in file Report1.rpt
Unable to connect: Inalid session parameters.

My code is as per follows

cry1.ReportFileName = app.path & "\Report1.Rpt"
cry1.LogonInfo(0) = "dsn=;uid=;pwd=cyber;dsq="
cry1.DataFiles(0) = App.Path & "\Data1.mdb"
cry1.Formulas(0) = "PatNo = " & txtnu_ChartId.Text
cry1.Formulas(1) = "TreatSeries = " & txtVistSeriesNo.Text
cry1.Formulas(2) = "SeriesStartDate=Date(" & Year(CDate(txtdt_SeriesStartDate.Text)) _
& "," & Month(CDate(txtdt_SeriesStartDate.Text)) _
& "," & Day(CDate(txtdt_SeriesStartDate.Text)) & ")"
cry1.Action = 1

I don't understand what could be the reason. Can you help me in solving this problem.

Amit Khardenavis|||Check the bellow line, using with date value manually if it's work, then the date value is invalid, Try again

cry1.Formulas(2) = "SeriesStartDate=Date(2003,01,01)"
--

if the value is text you should pass with quotation

cry1.Formulas(0) = "PatNo = '" & txtnu_ChartId.Text & "'"

yours,
Babu

Originally posted by akhardenavis
Hello Babu,

I think I have not enterprited my question properly to you. My problem is,

I have created one report in version 8.0. In that I have defined some formula fields and record selection formula. Now From VB programme I am calling that report file. The data file is password protected MDB file. I am giving password to data file as per your suggesion. Then I am specifying the formula field values. but I am gettign one error message when I am trying to activate report. the error message is as per follows

Error in file Report1.rpt
Unable to connect: Inalid session parameters.

My code is as per follows

cry1.ReportFileName = app.path & "\Report1.Rpt"
cry1.LogonInfo(0) = "dsn=;uid=;pwd=cyber;dsq="
cry1.DataFiles(0) = App.Path & "\Data1.mdb"

cry1.Formulas(0) = "PatNo = " & txtnu_ChartId.Text
cry1.Formulas(1) = "TreatSeries = " & txtVistSeriesNo.Text
cry1.Formulas(2) = "SeriesStartDate=Date(" & Year(CDate(txtdt_SeriesStartDate.Text)) _
& "," & Month(CDate(txtdt_SeriesStartDate.Text)) _
& "," & Day(CDate(txtdt_SeriesStartDate.Text)) & ")"
cry1.Action = 1

I don't understand what could be the reason. Can you help me in solving this problem.

Amit Khardenavis|||Hello Babu,

Thanks for your suggestions. I tried your both suggestions. All are correct but still my report is not getting activated.
One doubt came in my mind, Is it any problem if I convert any report from version 4.x to 8 and then trying to use?

Please tell me.

Amit Khardenavis|||Hi,

I am using the following code to view a report in VB.

---
Dim CrxApp As New CRAXDRT.Application
Dim CrxRpt As CRAXDRT.Report

Set CrxRpt = CrxApp.OpenReport("emp.rpt")

CrxRpt.DiscardSavedData
CRViewer1.ReportSource = CrxRpt
CRViewer1.ViewReport
----

This works fine. Now I want to use something similar to print the report without showing it on screen.

I searched this forum and got 2 methods of doing this

1) setting the destination property of the Crviewer object to the printer... However, I dont see a destination property for this object - (I am using crystal reports 8.5)

2) using CRViewer1.PrintReport

When I do this, I get a blank CrViewer control i.e. the control appears without the report and nothing is printed.

Where am I going wrong?

Thanks in advance
Satish|||hi,

Open object browser and select crystal report library, for more details aboud class objects.

yours,
K.Babu

Originally posted by Satishpp
Hi,

I am using the following code to view a report in VB.

---
Dim CrxApp As New CRAXDRT.Application
Dim CrxRpt As CRAXDRT.Report

Set CrxRpt = CrxApp.OpenReport("emp.rpt")

CrxRpt.DiscardSavedData
CRViewer1.ReportSource = CrxRpt
CRViewer1.ViewReport
----

This works fine. Now I want to use something similar to print the report without showing it on screen.

I searched this forum and got 2 methods of doing this

1) setting the destination property of the Crviewer object to the printer... However, I dont see a destination property for this object - (I am using crystal reports 8.5)

2) using CRViewer1.PrintReport

When I do this, I get a blank CrViewer control i.e. the control appears without the report and nothing is printed.

Where am I going wrong?

Thanks in advance
Satish|||hi,

Make sure all the formulas value are received correctly,

eg. Insert all the formula fields in crystal report, and then preview the formulas value are stored correct format, esspecially date value.

yours,
K.Babu

Originally posted by akhardenavis
Hello Babu,

Thanks for your suggestions. I tried your both suggestions. All are correct but still my report is not getting activated.
One doubt came in my mind, Is it any problem if I convert any report from version 4.x to 8 and then trying to use?

Please tell me.

Amit Khardenavis|||Hi Babu,

I'm not using Visual Basic, but I think you can help me with this problem. Is there a way to tell what version of Crystal Report is running on the computer? I have problem with printing multiple copies of a report on different versions of Crystal using Visual C++. I'm not too familiar with all the code interfacing with Crystal yet since I'm taking over a project that ist started by someone else. If I print on version 7.0 I get the correct number of copies, but if I print on version 8.5, I get an exponential number of copies. For example, if I put 3, I get 9 copies instead. I'm thinking if I can retrieve the version information, maybe I can get around this problem. Your help is greatly appreciated.

Thanks again,
CPB|||When using a record selection formula on a large database table (~60,000 records) it takes several minutes for the CRViewer to come up if it is searching for more than one record. If I remove the record selection formula and just let it do the whole MS Access Table I get the same slow response. The report is not a simple one. I am using the Crystal Report ActiveX Designer within my VB application because there are two different pictures that get loaded onto each report. The report uses info from four tables and also contains a subreport. If the recordselectionformula states a field and a unique value that only returns one record the report comes up in seconds. If two or more records meet the recordselectionformula then it takes several minutes. If you have any thoughts on how to improve its performance please let me know.|||Hello babu.

Please help me how i can access password protected database in crystal reports 8.0 with vb6 .how i can pass password at runtime to crystal reports please answer me soon.

Thanx in Advance.
Nazim|||I manually added a new column in my XML file.

I put it in both my schema and in the data section.

The new column does not show up in field explorer even though I disconnected and reconnected to the database, as well as, leaving and restarting Crystal.

Any ideas?

Thanks
Gary|||Never Mind.

My bad.

I had to choose verify database from the database menu for it to see the changed XML schema.|||hi

Use the following small code to access login and password from crystal report.

crCommon.LogonInfo(0)= "dsn=;uid=;pwd=Hello;dsq="
crCommon.DataFiles(0)= "C:\Mydata.mdb"

yours friendly,
k.Babu

Originally posted by nazimocp
Hello babu.

Please help me how i can access password protected database in crystal reports 8.0 with vb6 .how i can pass password at runtime to crystal reports please answer me soon.

Thanx in Advance.
Nazim|||hi Friends,

Make sure your database path was correct, when using "verify database" this may change the database full path of the report file.

This will cause problem when at distribute other computers.

yours friendly,
K.Babu

Originally posted by ghoran
Never Mind.

My bad.

I had to choose verify database from the database menu for it to see the changed XML schema.|||hi Friends,

Use stored query from your database, filter records using with parameters(), This will filter number of records when at using crystal report.

yours friendly,
k.Babu

Originally posted by masonad
When using a record selection formula on a large database table (~60,000 records) it takes several minutes for the CRViewer to come up if it is searching for more than one record. If I remove the record selection formula and just let it do the whole MS Access Table I get the same slow response. The report is not a simple one. I am using the Crystal Report ActiveX Designer within my VB application because there are two different pictures that get loaded onto each report. The report uses info from four tables and also contains a subreport. If the recordselectionformula states a field and a unique value that only returns one record the report comes up in seconds. If two or more records meet the recordselectionformula then it takes several minutes. If you have any thoughts on how to improve its performance please let me know.|||Thanx for ur answer but it did't solve the prob i am using crystal report 8.0 and ther is no property or method of logoninfo

crReport.LogonInfo(0) i counld not found this property in crystal report 8.0 but there is a method crReport.database.tables(0).setLogonInfo "Servername,uid,pass") but i am using database file driver not oledb or dsn i am using direct database file.

Please help me to solve this prob
thanx in advance
Nazim|||Hello babu ,

from where i can download crystal report ...

could you give me links ?

thankx ,,,|||Does anyone have an sample to show me how it works with visual c++?|||HI ,
i want to send array to crystal reports to print some information. Is it possible to pass an array to crystal report ?
plz suggest.

piter|||Hi,

When i want to print a report, windows nt tells me that crpaige(32).dll not found on path.

i put file named crpaig32.dll in system path. I try to register it by regsvr32 but DllRegisterServer entry point was not found. I imagine that this dll have not to be registered.

I don't known how to correct the problem since i use visual basic 6 instead of 5 version.

The problem appear only on client station where my soft is installed by Package deployment, there is no problem on the development computer.

Thanks for your help|||I have a problem. While using Crystal reports 4.6 with VB 6, I have to print a recipt with just one record. At times Crystal report shows an empty report. If I debug the report activation in VB, it works fine. I increase the time gap between the record fetching and report activation, i have put a loop of doevents: but still it fails at times. What do I do?:confused:|||hi babu, i have the same problem as i want to add image of parties on report . as you told to put picture field..does it mean the field from my table or from insert menu of crystal report.

plz help.
Zankhesh
Originally posted by K.Babu
hi,

Stores all pictures in database files using with OLE Object type.

Add the picture field in your crystal report.

yours,
K.Babu

MailID: k_babs@.hotmail.com|||hi babu, i have the same problem as i want to add image of parties on report . as you told to put picture field..does it mean the field from my table or from insert menu of crystal report.

as i am using the ms-access2000 as back-end and it that for ole data type it just store some number for any picture and if i put that picture fields from table the same number is visible in report in stead of actual image...
plz help.
Zankhesh
Originally posted by K.Babu
hi,

Stores all pictures in database files using with OLE Object type.

Add the picture field in your crystal report.

yours,
K.Babu

MailID: k_babs@.hotmail.com|||I have a vb .dll that invokes the crystal report view .OCX to view
reports before exporting them. I have added an 'export' button that
runs the following code:

m_oRpt.ExportOptions.Reset

m_oRpt.ExportOptions.PromptForExportOptions

'If the destinationType is not set then cancel must have been
pushed
If m_oRpt.ExportOptions.DestinationType <> crEDTNoDestination Then
m_oRpt.Export False
End If

The preview correctly displays the intended report and on dev system
this code runs fine.

On the site however there are two systems, a test system and a live
system. They both use different databases but the ODBC connection name is the same for each. The reports were developed on the live system and they work
fine on that system.

On the test system however, when the user exports the report (chooses .pdf
format, all pages, and a filename), the report fails to export and an
error is generated:

'No pages were exported'

This is even though the preview correctly displays the report and data.

In addition, if the report is *not* previewed ie the report viewer is
not loaded but the report just exported, it works fine.

Can anyone shed some light as to what this error message means and how
to fix it?

Thanks

Lindsay|||hi friends,

Both can be posible, if you had table with generalOLE field you can use the field directly to the crystal report to view the pictures.

Originally posted by zjain
hi babu, i have the same problem as i want to add image of parties on report . as you told to put picture field..does it mean the field from my table or from insert menu of crystal report.

plz help.
Zankhesh|||Hi!

I have a bit of problems when I try to pass a string(in C#, about 10000 characters) to a parameter field. It seems like the maximum datasize of a field is 255 characters. Is there any other way to pass dynamical data from a C# program and into the Crystal report.

Why do I want to do this? The report is supposed to show some kind of a program log so there is not a static amount of data. There is no database in the background of this program. The program itself collects the log data in its memory and then I want to pass it to the report.

All help and tips appreciated :)

/Anders

P.s I'm using the .Net Crystal Report together with C# D.s|||Hi,

if you want to pass more data to crystal report

Make the formula field given bellow concept

1. Fulldata
2. Data1
3. Data2
4. Data3
...

in Crystal report design time mode insert FullData formula field and add all the data1+data2+data3.

Note: This is one of the simplest way to pass more data, But it was not recommended for huge blob data.

Originally posted by Anders Jansson
Hi!

I have a bit of problems when I try to pass a string(in C#, about 10000 characters) to a parameter field. It seems like the maximum datasize of a field is 255 characters. Is there any other way to pass dynamical data from a C# program and into the Crystal report.

Why do I want to do this? The report is supposed to show some kind of a program log so there is not a static amount of data. There is no database in the background of this program. The program itself collects the log data in its memory and then I want to pass it to the report.

All help and tips appreciated :)

/Anders

P.s I'm using the .Net Crystal Report together with C# D.s|||Hi,

You have to install files which type of export format you have choosen, for eg. if you want to export option for pdf format at run time you should install pdf export related file in your testing machine

for more details refer the crystal report documentation for destribute files

Originally posted by lsmith
I have a vb .dll that invokes the crystal report view .OCX to view
reports before exporting them. I have added an 'export' button that
runs the following code:

m_oRpt.ExportOptions.Reset

m_oRpt.ExportOptions.PromptForExportOptions

'If the destinationType is not set then cancel must have been
pushed
If m_oRpt.ExportOptions.DestinationType <> crEDTNoDestination Then
m_oRpt.Export False
End If

The preview correctly displays the intended report and on dev system
this code runs fine.

On the site however there are two systems, a test system and a live
system. They both use different databases but the ODBC connection name is the same for each. The reports were developed on the live system and they work
fine on that system.

On the test system however, when the user exports the report (chooses .pdf
format, all pages, and a filename), the report fails to export and an
error is generated:

'No pages were exported'

This is even though the preview correctly displays the report and data.

In addition, if the report is *not* previewed ie the report viewer is
not loaded but the report just exported, it works fine.

Can anyone shed some light as to what this error message means and how
to fix it?

Thanks

Lindsay|||Hi,

Disable Stored Data with Report option in your crystal report design mode, and refresh preview data.

Originally posted by zjain

as i am using the ms-access2000 as back-end and it that for ole data type it just store some number for any picture and if i put that picture fields from table the same number is visible in report in stead of actual image...
plz help.
Zankhesh|||Hi,

Make sure the problem was only for the time delay, Are you sure with that don't use "doevents" use API Delay or use timer control for a time delay show wait screen form, after release the timer control, view the crystal report.

Originally posted by amyn_d
I have a problem. While using Crystal reports 4.6 with VB 6, I have to print a recipt with just one record. At times Crystal report shows an empty report. If I debug the report activation in VB, it works fine. I increase the time gap between the record fetching and report activation, i have put a loop of doevents: but still it fails at times. What do I do?:confused:|||Thanks for your answer Babu. :)

Do you know any other solution as I do have huge blob data :(

/Anders|||hi,

im workin on a invoicing program , i was told to make the current reports fit in the pre-printed invoice paper.

the problem is:

as i print jus one invoice i ill turn out ok,
but if i print more than 4 invoices, the report will slowly start going down just a little bit each invoice so when it gets to the 4 invoice the printed report will be off like for a line...

dont know if i explained well enough,

ex:
1 invoice:
________________________

[notice there are two lines]
zzzzz
qwqqwe
fgdddfd

{details}
totals
_________________________
2 invoice:
_________________________

zzzzz
qwqqwe
fgdddfd

{details}
totals
_________________________
3 invoice:
_________________________

zzzzz
qwqqwe
fgdddfd

{details}
totals
_________________________
4 invoice:
_________________________
[notice there is just one line now]
zzzzz
qwqqwe
fgdddfd

{details}
totals
_________________________

if any of you know how to solve this or has any ideas...
please let me know
shuzz7@.yahoo.com|||Hi, Babu, look, i got this problem: I have built an application in VB6 with crystal report 8.0. the report works fine, but when trying to export it (.xls, .doc, and others..) using the envelope button, it seems to be exporting but it does nothing. Only i get is a file 0 bytes long. Any ideas?|||Hi,

Measure your preprinted invoice height, change page setting to custom (width/height) at crystal report design time.

Originally posted by shuzz
hi,

im workin on a invoicing program , i was told to make the current reports fit in the pre-printed invoice paper.

the problem is:

as i print jus one invoice i ill turn out ok,
but if i print more than 4 invoices, the report will slowly start going down just a little bit each invoice so when it gets to the 4 invoice the printed report will be off like for a line...

dont know if i explained well enough,

ex:
1 invoice:
________________________

[notice there are two lines]
zzzzz
qwqqwe
fgdddfd

{details}
totals
_________________________
2 invoice:
_________________________

zzzzz
qwqqwe
fgdddfd

{details}
totals
_________________________
3 invoice:
_________________________

zzzzz
qwqqwe
fgdddfd

{details}
totals
_________________________
4 invoice:
_________________________
[notice there is just one line now]
zzzzz
qwqqwe
fgdddfd

{details}
totals
_________________________

if any of you know how to solve this or has any ideas...
please let me know
shuzz7@.yahoo.com|||Hi,

Make sure all the crystal report export envelope option fails or not, if it's all export fails this may export related files correption reinstall crystal report and then try again.

Originally posted by VTDrakull
Hi, Babu, look, i got this problem: I have built an application in VB6 with crystal report 8.0. the report works fine, but when trying to export it (.xls, .doc, and others..) using the envelope button, it seems to be exporting but it does nothing. Only i get is a file 0 bytes long. Any ideas?|||hi Babu,

i already set the size of the paper, but the printer on the first invoice at the begining of the page will make a little jump...
like this::

------------top of the page[the cut]
[this one line is the one that the printer makes]
start of the printing

------------top of the page[not he cut,
start of the printing [here it starts printing]

thanks again..
Esteban Rojas|||Hi,

Hide report title, summay sections. make sure your printer configuration preload lines are correctly set in first(zero) row.

Originally posted by shuzz
hi Babu,

i already set the size of the paper, but the printer on the first invoice at the begining of the page will make a little jump...
like this::

------------top of the page[the cut]
[this one line is the one that the printer makes]
start of the printing

------------top of the page[not he cut,
start of the printing [here it starts printing]

thanks again..
Esteban Rojas|||i am also using crystal report ..
but dont know how to print report in dos mode
can u help me sir
plz|||Hi,

Save Print output to .prn file,

do the following command in DOS Mode

C:\>copy myfile.prn lpt1

Originally posted by atul_tak
i am also using crystal report ..
but dont know how to print report in dos mode
can u help me sir
plz|||Please help me how to crystal report connect to database(SQL Server) within code Visual Basic.
Thanks!|||Please help me how to crystal report connect to database (SQL Server) within code Visual Basic.

Ex:
in MS Access:
crCommon.LogonInfo(0)= "dsn=;uid=;pwd=madras;dsq="
crCommon.DataFiles(0)= "C:\Mydata.mdb"

in SQL Server?
crCommon.LogonInfo(0)= ?
crCommon.DataFiles(0)= ?

Login info:
Server name: THIENLOC
Database name: PAYROLL
UserID: sa
Password:

Thanks!|||Refer

cr.LogonServer (dllName$, ServerName$, DatabaseName$, UserID$, Password$)

Originally posted by thienloclt
Please help me how to crystal report connect to database (SQL Server) within code Visual Basic.

Ex:
in MS Access:
crCommon.LogonInfo(0)= "dsn=;uid=;pwd=madras;dsq="
crCommon.DataFiles(0)= "C:\Mydata.mdb"

in SQL Server?
crCommon.LogonInfo(0)= ?
crCommon.DataFiles(0)= ?

Login info:
Server name: THIENLOC
Database name: PAYROLL
UserID: sa
Password:

Thanks!|||Hi K.Babu,

Please tell me what is the "dllname$"?
Would you give me a example of "dllname$"?
Thanks!|||Logs on to a SQL server.

Usage

[form.]Report.Connect[= Name;UserID;Password;DatabaseQualifier$]
For example:

Report1.Connect = "DSN = Accounting;UID = 734;PWD = bigboard;DSQ = Administration"

Originally posted by thienloclt
Please help me how to crystal report connect to database(SQL Server) within code Visual Basic.
Thanks!|||PDSODBC.DLL".

PDB*.DLL for standard (nonSQL) databases
PDS*.DLL for SQL/ODBC databases.

Originally posted by thienloclt
Hi K.Babu,

Please tell me what is the "dllname$"?
Would you give me a example of "dllname$"?
Thanks!|||hi Mr. Balu,

i am working with a VB/Crystal Reports project. I want to print payslips using Crystal Reports. My problem is it is becoming difficult for me to contain some payslips in one page. Payslip has 3 sections a group header, Details and group section. All the 3 sections should be together. The "Keep Together" property is not working. how do i do this? how can i force a page break whenever i need while printing?

please help. thanks in advance.|||Hello Babu,

I was wondering if there is a way that I could type in some text in VB 6.0 and post that data from a Textbox into a field or label in a Crystal Reports Page/Report Header?

Thanks,
John-|||Hi,

Right Click the Format Section and tick the option check box called as "New Page After"

Keep Together the option scope for current section.

Originally posted by N Vikram
hi Mr. Balu,

i am working with a VB/Crystal Reports project. I want to print payslips using Crystal Reports. My problem is it is becoming difficult for me to contain some payslips in one page. Payslip has 3 sections a group header, Details and group section. All the 3 sections should be together. The "Keep Together" property is not working. how do i do this? how can i force a page break whenever i need while printing?

please help. thanks in advance.|||Cr.BoundReportHeading = "Report Title Message"

Originally posted by vbjohn
Hello Babu,

I was wondering if there is a way that I could type in some text in VB 6.0 and post that data from a Textbox into a field or label in a Crystal Reports Page/Report Header?

Thanks,
John-|||hi,
I designed file .rpt in crystal report (add in) within VisualBasic

Currently, crystal report shows following form:

Order_Code Quantity
ma001 10
ma001 5
ma001 7
ma002 8
ma002 12

How to crystal report will show following form (group):

Order_Code Quantity
ma001 10
5
7
ma002 8
12

Thansks.|||Hi,

a. Insert Group Section for Order_Code

1. Paste the order_code field in "order_coder header section"

b. In Details section paste the quantity field.

Originally posted by thienloclt
hi,
I designed file .rpt in crystal report (add in) within VisualBasic

Currently, crystal report shows following form:

Order_Code Quantity
ma001 10
ma001 5
ma001 7
ma002 8
ma002 12

How to crystal report will show following form (group):

Order_Code Quantity
ma001 10
5
7
ma002 8
12

Thansks.|||Hi,
1.
Please help me solve bug:
I have code:
If crystal.LogOnServer("PDSODBC.DLL", "MQIS", "PAYROLL", "SA", "") Then
crystal.ReportFileName = App.Path & "\reports\" & "contact.rpt"
crystal.Action = 1
End If

on line "crystal.Action = 1" --> error: "Cannot open SQL Server"

2. What are differences between cr.Connect and cr.LogOnServer?

Thanks!|||Hi,
Please help me!
I have SQL statement:

SELECT e1.FullName, (SELECT e2.FullName FROM EmployeeTb AS e2 WHERE e2.EmployeeId = a1.AppraiserId) AS AppraiserName
FROM EmployeeTb e1 INNER JOIN AppraisalTb a ON e1.EmployeeId = a.EmployeeId

How to I design in crystal report to show following form:

EmployeeName AppraiserName
A C
B E
C
D F
E A
F

Thanks!|||I tried...

Cr.BoundReportHeading = "Report Title Message"

But nothing printed on the report. I think you kind of mis-understood what I was going for...

As you can see on the .gif image. Where it says *testing* I need to have text in a textbox in VB and post that text into a field or label in a Crystal Reports Page/Report Header?

I hope this clears things up more.

John-|||Hi,

"Connect" is cr property which is log on to SQL Servre, it must required ODBC driver

"LogonServer" is a method it returns connection id, This connection id used for "LogoffServer" method. you can use DSN ODBC Data Source here.

Originally posted by thienloclt
Hi,
1.
Please help me solve bug:
I have code:
If crystal.LogOnServer("PDSODBC.DLL", "MQIS", "PAYROLL", "SA", "") Then
crystal.ReportFileName = App.Path & "\reports\" & "contact.rpt"
crystal.Action = 1
End If

on line "crystal.Action = 1" --> error: "Cannot open SQL Server"

2. What are differences between cr.Connect and cr.LogOnServer?

Thanks!|||Create formula fields in crystal report design time

eg. RepTitle (assume your formula field name is RepTitle)

in vb

cr.formulas(0) = "RepTitle = 'Hello world'"

Originally posted by vbjohn
I tried...

Cr.BoundReportHeading = "Report Title Message"

But nothing printed on the report. I think you kind of mis-understood what I was going for...

As you can see on the .gif image. Where it says *testing* I need to have text in a textbox in VB and post that text into a field or label in a Crystal Reports Page/Report Header?

I hope this clears things up more.

John-|||hi K.Babu,

I designed file .rpt in crystal report (add in) within VisualBasic

Currently, crystal report shows following form:

Order_Code -------- Quantity
ma001 ---------- 10
ma001 ---------- 5
ma001 ---------- 7
ma002 ---------- 8
ma002 ---------- 12

How to crystal report will show following form (group):

Order_Code -------- Quantity
ma001 ---------- 10
------------- 5
------------- 7
ma002 ---------- 8
------------- 12

Thansks.|||Hi,

1. method:
Right Click the Order_Code field, click the change format, tick the suppress if duplicated option check box.

2. method:
Create new Group for Order_Code field in crystal report design mode, insert the order_code field in new created order_code group.

Originally posted by thienloclt
hi K.Babu,

I designed file .rpt in crystal report (add in) within VisualBasic

Currently, crystal report shows following form:

Order_Code -------- Quantity
ma001 ---------- 10
ma001 ---------- 5
ma001 ---------- 7
ma002 ---------- 8
ma002 ---------- 12

How to crystal report will show following form (group):

Order_Code -------- Quantity
ma001 ---------- 10
------------- 5
------------- 7
ma002 ---------- 8
------------- 12

Thansks.

No comments:

Post a Comment