472,094 Members | 2,494 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Crystal viewer

Dear NG,

I have Crystal Reports working to a file and directly to the printer with
the following:

private void mnuInvRep1301_Click(object sender, System.EventArgs e)
{

ReportDocument report = new ReportDocument();

report.Load("C:\\database\\MCS-3-SQL\\MCS-3inC#\\INV\\Reports\\rpt1301.rpt")
;

//Send report to a file

//report.ExportToDisk(CrystalDecisions.Shared.Export FormatType.RichText,"C:\
\tmp\\CrystalOut.rtf");

//Send report directly to the default printer

report.PrintToPrinter(1, false, 0, 0);

MessageBox.Show("Crystal terminated normally");

}

I would like to use the Windows viewer. I have created Form1. I added the
ReportDocument to Form1. On a menu item click I would like to instantiate
the form to myForm and then use the form as follows:

myForm.ShowDialog();

How do I instantiate the form?

TIA - Bob (bo*@s-i-inc.com)
Nov 16 '05 #1
3 4337
Hi Robert,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to view crystal report on a
windows form. If there is any misunderstanding, please feel free to let me
know.

As far as I know, if you need to view it on a windows form, you need to
place a crystal report viewer on the form, and assign the report document
report source to the viewer. Then you just use the following to show dialog
box.

Form1 myForm = new Form1();
myForm.ShowDialog();

Crystal Report is not supported by Microsoft. For more information related
to this issue please check the following link:
https://support.crystaldecisions.com

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #2
Thank you Kevin,

That worked fine. I have a few formating issues, like landscape
orientation, but I am off and running. I have a lot of C# and Crystal
learning to do, but I am well on my way. Is Crystal Reports the best way to
integrate about 100 reports from a SQL database using C#?

Cheers,

Bob

Robert Schuldenfrei
bo*@s-i-inc.com
"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:4H*************@cpmsftngxa06.phx.gbl...
Hi Robert,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to view crystal report on a
windows form. If there is any misunderstanding, please feel free to let me
know.

As far as I know, if you need to view it on a windows form, you need to
place a crystal report viewer on the form, and assign the report document
report source to the viewer. Then you just use the following to show dialog box.

Form1 myForm = new Form1();
myForm.ShowDialog();

Crystal Report is not supported by Microsoft. For more information related to this issue please check the following link:
https://support.crystaldecisions.com

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #3
Hi Again,

I thought I could adjust the viewer properties without any further aid from
the NG, but I was wrong. When I print my reports to a file or directly to
the printer, the orientation is landscape. This was set in the report
itself using Designer | Printer Setup and setting the printer to landscape.
When I send the report to the viewer, using the statements listed below, the
lines are truncated because the viewer is defaulting to portrait
orientation. How can I change this viewer property? The book I am using is
Neil FitzGerald et. al., Using Crystal Reports 10. It is very good at
explaining Crystal, but is very brief on explaining the .NET material. As
ever, thank you in advance for your help.

Sincerely,

Bob

Robert Schuldenfrei
bo*@s-i-inc.com
"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:4H*************@cpmsftngxa06.phx.gbl...
Hi Robert,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to view crystal report on a
windows form. If there is any misunderstanding, please feel free to let me
know.

As far as I know, if you need to view it on a windows form, you need to
place a crystal report viewer on the form, and assign the report document
report source to the viewer. Then you just use the following to show dialog box.

Form1 myForm = new Form1();
myForm.ShowDialog();

Crystal Report is not supported by Microsoft. For more information related to this issue please check the following link:
https://support.crystaldecisions.com

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Leon Jollans | last post: by
reply views Thread by The Fantom | last post: by
5 posts views Thread by Robert Schuldenfrei | last post: by
1 post views Thread by Karthic | last post: by
5 posts views Thread by Atley | last post: by
4 posts views Thread by krgatez | last post: by

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

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