Friday, March 9, 2012
Problem with report.papersize when printing in crystal report
at first i'm using crpaperfolio value for used with printer that has default folio setting..
but yesterday the printer was replaced by printer which don't have default folio setting..so when i print the result is not good (not full)...
i already change the report.papersize property value with crdefaultpapersize but it still the same (not good), but if i change the value to crPaperLegal then the result is good.
my question is how to make my report papersize to be dynamic and doesn't have to change the papersize property manually?? like my problem above.(folio -> legal).
thanks alot.please, any suggestion or information are needed..
thanks.
Saturday, February 25, 2012
Problem with printing report directly to printer
Hello,
I am trying to get a SSRS 2005 report to print from my Visual Studio 2005 C++ application without using the ReportViewer to preview it first. What I have done is created a dll that I call into when I want to access a certain report and print it. While searching around on the internet I found an MSDN article about printing a report without previewing and it had an example in C# code. So I used that as a guide for my C++ code but I am still having problems with rendering the report properly so it can be printed. When I try to render a report using the "Image" format, my streamid string is empty but the byte array that the render routine returns is not. Here is the code I am using, what could be the problem here?
Note: m_Streams is define elsewhere as
array<String^>^ m_Streams = gcnew array<String^>(10);
void Print::Export(LocalReport^ report)
{
array<Warning^>^ Warn = gcnew array<Warning^>(10);
String^ deviceinfo =
"<DeviceInfo>" +
" <OutputFormat>EMF</OutputFormat>" +
" <PageWidth>8.5in</PageWidth>" +
" <PageHeight>11in</PageHeight>" +
" <MarginTop>0.25in</MarginTop>" +
" <MarginLeft>0.25in</MarginLeft>" +
" <MarginRight>0.25in</MarginRight>" +
" <MarginBottom>0.25in</MarginBottom>" +
"</DeviceInfo>";
String^ mimeType;
String^ enc;
String^ FileExt;
array<Byte>^ bytes;
bytes = report->Render("Image",deviceinfo, mimeType, enc, FileExt, m_Streams,Warn); // m_Streams has a length of
return; // 0 after the Render
}
void Print:: PrintPage(System:: Object^ sender, System:: Drawing:: Printing:: PrintPageEventArgs^ ev)
{
Metafile^ pageImage = gcnew Metafile(m_Streams[m_CurrentPage]);
ev->Graphics->DrawImage(pageImage, ev->PageBounds);
m_CurrentPage++;
ev->HasMorePages = (m_CurrentPage < m_Streams->Length);
return;
}
void Print:rintRpt()
{
String^ printerName = "Default";
if (m_Streams->Length < 0)
return;
PrintDocument^ printDoc = gcnew PrintDocument();
if (!printDoc->PrinterSettings->IsValid) {
return;
}
printDoc->PrintPage += gcnew PrintPageEventHandler(this, &Print:: PrintPage);
printDoc->Print();
return;
}
void Print::Run()
{
LocalReport^ report = gcnew LocalReport();
DataSet^ ds = gcnew DataSet();
LoadData(ds);
report->ReportPath = "c:\\bmi\\bulrpt\\Report1.rdlc";
ReportDataSource^ RDS = gcnew ReportDataSource();
RDS->Name = "DataSet1_Subject";
RDS->Value = ds->Tables["Subject"];
report->DataSources->Add(RDS);
Export(report);
PrintRpt();
return;
}
DataTable^ Print:: LoadData(DataSet^ ds)
{
System:: String ^ConnStr = "SELECT * FROM Subject";
SqlConnection^ conn = gcnew SqlConnection("Data Source=JOE-PC\\BMIMSDESERVER; Initial Catalog=stx52013;Integrated Security = TRUE");
SqlCommand^ command = gcnew SqlCommand(ConnStr, conn);
SqlDataAdapter^ adapt = gcnew SqlDataAdapter(command);
adapt->TableMappings->Add("Table", "Subject");
conn->Open();
adapt->Fill(ds);
return ds->Tables["Subject"];
}
I had the same problem with that render method and simply looped until the byte lenth was zero and that worked. There is another example out there that used the second overload of the method that works pretty much as is. In that one you pass a call back event handler.
|||I've tried to do
bytes = report->Render("Image",deviceinfo, &Print::CreateStream,Warn);
as well but when I compile that I get the error -
error C3374: can't take address of 'Print::CreateStream' unless creating delegate instance
What does this mean?
Problem with Printing of Crystal Report
I have an application which uses crystal reports.
Only the runtime dll's are shipped with the application in order to design and also print.
I'm unable to print the report .I guess some mandatory runtime dll's are missed
to ship with the application.
Can anyone help me out in listing all the runtime dll's used for crystal report printing? I use Crystal report 9.0 version dll's.
If I install crystal reportDesigner, then the print option works.
Regards
PallCrystal Reports 8.5 comes with a file called runtime.hlp that lists all the runtime files needed and (I believe) their dependencies. Maybe version 9 has something similar?
I use InstallShield to create my Setups. There's a download for InstallShield that will add all the MergeModules for Crystal Reports. (A MergeModule is a collection of system files and their dependecies.) You just check off the ones you need and it takes care of installing all the dependency files.|||Open your crystal reports in EDIT mode and open the printer / printing options. Uncheck the NoPrint option.
This problem is with CR 8.0.
Problem with printing database diagrams
SQL2005 has been patched to SP2.
I have circumvented the problem by writing an SSRS package to print the output of a stored procedure that emulates the database diagram. Also there is an option in SQL2005 database diagrams to get an image of the diagram. I have printed this in Word and it prints flawlessly that way.
I believe this is an unique problem you are facing and I think nothing much done from SQL dev. team.
See thsi http://www.codeproject.com/dotnet/ScriptDiagram2005.asp is any help and you can report the same to MS Connect website http://connect.microsoft.com/
|||Regrettably I still have the problem with diagram on SQL2005 (but SQL2000)|||
This is not a unique problem.
I've been encountering it for a month or two.
It's intermittent. Sometimes the diagrams are okay, sometimes these boxes obscure fields.
My only work-around is to PRINT SCREEN and then copy it into Word and print it.
|||We are having this same problem. If you copy to Word it will print. Has there been a solution found yet?|||Copying to Word is a good work-around, but is not a solution. It did happen with all the printers I could try at that site.Problem with printing bank bills
I have done a Crystal Report document with the heigth of a bank bill, with the option of printing in a continuous paper in a matrix printer.
Then I create a PDF document, but when I print them, at the end of each page of the PDF document, i have a blank. And this blank is what moves the next bills to another position and here it is the problem. I don't know why is this blank.
I have search in internet but i don't know what to do. I have done all in c# language.
Is there anyone who has printed bank bills with c#? Any ideas?
Thanks.Try Suppressing footers if data is not there to display.
Problem with printing
Hi! I recently begin to use reporting tools of SLQ 2005 instead of AR or CR. I found the DUI very easy to use and I'm partially sastify beause when I try to print my report, the printer always blow out a second white page. For one page report I can live with that but for 156 page report it's becoming a lot annoing. Is there somebody who experience the same problem? And by the way resolve it?
Here the dexcription of the report:
Is a list grouped by clientId with a sub report getting the clientId from the parent one as the parameter. Event with the insert page break after list true or false the result is the same while printing.
Thx you very much
Daniel
This has to do with the sum of your margins and page settings must not exceed the portrait / landscape settings in your report. The link below gives a good example of this.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1259621&SiteID=1
|||That resolve my problem thank you very much.|||Glad to help. Please remember to mark the correct answer as "Mark as answer". This will aid others searching for similar problems and issues.
Thanks!
Problem with printing
Hello everybody,
i have used report viewer control in my win app, (c#, .net 2.0) and from msql i get data, fill necessary tableadapters and print report. Everything works fine on my computer, i generate report from template, push Print button in report viewer, Print dialog appears and i print the report by clicking OK.
The problem occurs in another computer, where i launch my app, i generate report, push Print button, and when appears print dialog happen strange things:
1. In print dialog i push "Print" button once, and nothing happens, Print dialog is still on top, then i push second time Print and then i can see that to pages is sended to printer (but my report is only one page). Printer does nothing, in printer schedulles there is no jobs.
2. So i press Print button in report viewer second time, Print dialog appears again, i click Print button nothing happens, then i push second time Print button i can see that 1 page is sended to printer, Print dialog disapear and now printer print my report correctly.
and this mesh is everytime i generate report and want to print it. Printer is installed correctly, i tried newest drivers for it. For example with ms office word everything works fine.
Could it be report viewer bug? what are the ways to find out what is wrong?
I have had the same problems in reporting services. Sometimes it doesn't print, sometimes it does. Sometimes it prints just the one page. Sometimes it prints multiple. I have tried just messing with the margins in the Report Properties menu button. I have found that SSRS doesn't print the report evenly on the page, too, so having compensated by setting the left margin .5 inches less then the right margin it now doesn't print more then one page as often. I don't know if that exact tweek will work for you, but maybe that will give you an idea what to look for. I would assume that most of these things are bugs, but they are not too hard to work around. Good luck!|||What version of SSRS are you running? Go to http://<server>/ReportServer and note the number in the bottom right. 9.00.1399.00 is RTM (release to manufacturer) and it has known issues printing. There was a hotfix released for what might be your problem, but you should get the latest service pack (SP2) as it rolls up all of the fixes and has been through more testing.
Good luck,
Larry
|||I have version 9.00.1406.00 and it still has some problems with printing. Is this the latest version?|||Here is a list of build numbers for the various versions of SQL Server 2005 and it indicates that you have a single patch installed (KB 932557) but that is all: 932557) but that is all: http://www.sqlservercentral.com/columnists/sjones/2960.asp
You may well find that applying SP2 will fix your issue.
Larry