Showing posts with label crystal. Show all posts
Showing posts with label crystal. Show all posts

Wednesday, March 28, 2012

How do I link two different field lengths with the same data

Hi,
In Crystal Reports 8.5, I am linking one file to another but do not get report data. The reason is the fields I am using to link one string is 4 characters while the other is 6. Is there a way to get two fields containing the same data in different files but wth different field lengths to link. thank youBump. This post is old, but I'm needing to do basically the same thing. I've got Crystal Reports 11.

Thanks

How do I know the version of Crystal Reports that I am using ??

How do I know the version of Crystal Reports that I am using. I am using Crystal Reports that has come bundled with Visual Studio 2003. How do I know its Version ?Open it? Help -> About.

Friday, March 23, 2012

How do I in Crystal 10

Using CRYSTAL 10.
A field titled INVOICE NUMBER always has *0000000 at the end. These are extraneous characters I do not need on the report. How do I remove them from the Invoice Number field. The field length is 25; and, again, I do not need the last eight characters.If it is a character field then u can use SQL expression , and builtin function substring.sql

Friday, February 24, 2012

How do I embed and retrieve Crystal Reports from my app

Using VB .Net 2005 with Crystal Reports XI Release 2. I have a form that has a CrystalReportViewer control on it. When someone prints I run a sub that create a new instance of the form, creates a new reportdocument, loads the report to the new document, then passes the document to the report viewer on the form. This works great except I would like to either embed my crystal reports directly into my app or better yet embed them into thier own reports dll file. I want to do this so updates are easier and I can use the "Publish" function of VB 05 which doesn't seem to like publishing all the seperate files. The embedding should be the easy part, just set them as embedded resource. But I'm having trouble with the syntax to pull them out. For example you can use this to pull out a embdded icon:
Function GetEmbeddedIcon(ByVal strName As String) As Icon
Return New Icon(System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream(strName))
End Function

But I cannot get the syntax right to pull out and return a crystal report. Anyone have any ideas on how to pull the reports back out or a better way to do this. I dont have a lot of reports, about 15 right now, but that could grow.

-AllanWell...I couldn't find the answer anywhere and no one replied here. But I figured it out so I might as well help someone down the road.

Set your crystal reports to "embedded resource" and the copy to "do not copy". Then in your code you can clal them like any other object with a "New (reportname)". For example I have a crystal reports viewer control (apptly named CrystalReportViewer) on a form called ReportViewerForm. I made a small sub to print reports:

Friend Sub PrintReports(ByVal myReportFileName As ReportDocument, Optional ByVal mySQLFormula As String = "")
' Prints out reports pass to it by other procedures and forms.
Dim PrintPreview As New ReportViewerForm
Try
If mySQLFormula <> "" Then myReportFileName.RecordSelectionFormula = mySQLFormula
PrintPreview.CrystalReportViewer.ReportSource = myReportFileName
PrintPreview.ShowDialog()
Catch ex As CrystalDecisions.CrystalReports.Engine.EngineException
MsgBox("A error was generated by the Crystal Reports engine. Error details: " & ex.Message, MsgBoxStyle.Critical, "Engine Error")
Finally
myReportFileName = Nothing
PrintPreview = Nothing
End Try
End Sub

Then when I need to print a report, for example my Log report (called LogEntryReport.rpt) I call it like this:

PrintReports(New LogEntryReport, "{qLogEntryReport.LogIdNumber} = " & CurrentLogId)

passing my report as a new ReportDocument and my sql command (which is optional for those reports that don't need it). Now I can have one routine that will display reports and call it from anywhere passing the report name. Works dandy and the reports are embedded in the app...less clutter.

Hopefully this helps someone and its not a waste of bandwidth.

-Allan.

how do i do this using Crystal Reports IX?

Hi all,

Please help me with my CR IX problems...I am new to crystal reports.

I have a table that consist of:
[City, Program, Type of Payment, Total # of participants]
example:
[LA, Aerobics, Cash, 100
LA, Aerobics, Credit, 120
LA, Dance, Cash, 50
LA, Dance, Credit, 20]

I wanted to do a report so that it will show the folowing datas:
[City, $Aerobics, $Dance, CR Aerobics, CR Dance, Total]
example:
[LA, # of participants in Aerobics that pay by cash, # of participants in Dance that pay by cash, # of participants in Aerobics that pay by credit card, # of participants in Dance that pay by credit card, Total # of participants in LA]

Thank you very much in advance for your answer and time.
Have a wonderful day!Do a group by 'City' field. Create running total for #of participants and
select 'Use a formula' option. Use the following formula :

if Program="Aerobics" and Type of Payment="Cash" then
true
else
false;

This will give you the total # of participants with Cash payment for Aerobics. Similar running totals for Credit card payment etc.

Hope this helps!
Rashmi

How do I do this in crystal report?

Hi, I am currently using crystal report 8.0. I need to create a report that instead of print downwards i need it go sideway. For eg normal report

00512789
1

00512567
2

but i need to do this

00512789 00512567
1 2

I tried using the cross tab report but it does not suit my needs. And also the report is actually taking data from 3 queries but the input for all 3 queries is the same. How do i let users to enter the parameter once for all 3 queries. Any help is appreciated. Thank youHi,

As per my understanding u want to show ur data Horizontally insted of vertically.
If m i right then, u try with "Format Page With Multiple Columns" functionality

I sure u get the solution which u r looking for

-Yags