Suppress Printing
How could I suppress exporting report if no records are loaded using sdk? If setting options in report to suppress i get blank page in pdf when exporting, is there a way to evaluate if fields have data or not? Is there a way to retrieve sql statement sent to database from report evaluate the statement and see if there are rows returned. Help!!!
You can use RAS InProc to find out how many records are in your result set. This works if you are using Crystal Reports XI R1 SP2 (or something newer).
This does not work with: Crystal Reports 9, 10, or any of the bundle editions of Crystal Reports (9.1, 10.2, 10.5).
Here is a sample.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.ReportAppServer.ClientDoc;
using CrystalDecisions.ReportAppServer.Controllers;
using CrystalDecisions.ReportAppServer.DataDefModel;
namespace ras115_get_row_count
public partial class Form1 : Form
public Form1()
InitializeComponent();
private void button1_Click(object sender, EventArgs e)
ReportDocument boReportDocument = new ReportDocument();
ISCDReportClientDocument boReportClientDocument = null;
RowsetController boRowsetController;
RowsetCursor boRowsetCursor;
int rows;
boReportDocument.Load(Application.StartupPath + "\\..\\..\\CrystalReport1.rpt");
boReportDocument.Refresh();
boReportDocument.SetParameterValue(0, 12);
boReportClientDocument = boReportDocument.ReportClientDocument;
boRowsetController = boReportClientDocument.RowsetController;
boRowsetCursor = boRowsetController.CreateCursor(new GroupPath(), new RowsetMetaData(), 0);
rows = boRowsetCursor.RecordCount;
MessageBox.Show(rows.ToString());
boReportDocument.Close();
Similar Messages
-
Blank Page prints even though "Suppress Printing If No Records" option is t
Blank Page prints even though "Suppress Printing If No Records" option is thicked.
My environment:
Crystal Report Developer Full version 11.5.11.1470
Windows Server 2003 SP2 32-bit.
We have a third party vendor application written in Java -let's call it "print deamon", but my company doesn't have access to the source code.
The print deamon essentially listens to the core application which is located remotely, receive some print instructions such as label name, printer name, crystal reports version (8.5 or 11) and a few parameters that are passed to the crystal report template.
When the version is Crystal Reports 11 and the template is open and query is executed (using Oracle JDBC) and if the template's query does not retrieve any rows, a blank page still prints even though the option to suppress printing is thicked.
With Crystal Reports 8.5 version, we have no issues.
recycling the blank page is not an option in our high volume print environment, these paper and labels are wasted big time, third party vendor says this is an issue with crystal reports XI api.
These are some of the libraries the Print Deamon uses:
09/25/2009 10:29 AM 2,055,844 cecore.jar
09/25/2009 10:29 AM 211,919 celib.jar
09/25/2009 10:29 AM 830,301 corbaidl.jar
09/25/2009 10:29 AM 371,142 CRDBJavaServerCommon.jar
09/25/2009 10:29 AM 121,413 CRDBXMLServer.jar
09/25/2009 10:29 AM 670,312 CrystalCharting.jar
09/25/2009 10:29 AM 2,162 CrystalCommon.jar
09/25/2009 10:29 AM 94,290 CrystalContentModels.jar
09/25/2009 10:28 AM 110,657 CrystalDatabaseConnectors.jar
09/25/2009 10:29 AM 686,963 CrystalExporters.jar
09/25/2009 10:29 AM 67,807 CrystalExportingBase.jar
09/25/2009 10:29 AM 581,270 CrystalFormulas.jar
09/25/2009 10:29 AM 330,909 CrystalQueryEngine.jar
09/25/2009 10:29 AM 2,271,217 CrystalReportEngine.jar
09/25/2009 10:29 AM 453,829 CrystalReportingCommon.jar
09/25/2009 10:29 AM 1,985,441 ebus405.jar
09/25/2009 10:29 AM <DIR> external
09/25/2009 10:29 AM 227,996 jrcadapter.jar
09/25/2009 10:29 AM 9,988 jrcerom.jar
09/25/2009 10:29 AM 94,180 keycodeDecoder.jar
09/25/2009 10:29 AM 448,627 MetafileRenderer.jar
09/25/2009 10:29 AM 380,520 rasapp.jar
09/25/2009 10:29 AM 843,544 rascore.jar
09/25/2009 10:29 AM 283,131 ReportPrinter.jar
09/25/2009 10:29 AM 793,445 ReportViewer.jar
09/25/2009 10:29 AM 95,382 rpoifs.jar
09/25/2009 10:29 AM 40,545 Serialization.jar
09/25/2009 10:29 AM 3,777 URIUtil.jar
Let me know if there's anything we can do before engaging our third party vendor to produce their source code.
Thank you - KleberIt's not relavent now is it? Do what ever works in CR XI.
Also you may want to upgrade to CR XI R2. Go to this link: http://www.sdn.sap.com/irj/boc and download the trial version of CR XI R2 and use your XI keycode, then apply the patches which you can get to by clicking on the BusinessObjects tab above, then Downloads.
Direct link to the Trial version: http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx
Once updated you can then go to the Keycode site and get a XI R2 keycode to enable oll of the features.
Thank you
Don -
Suppress printing of blank records
This should be simple, but I have tried everything I can think of, and trolled through the archives, without finding an answer. Please don't chastise me for asking a question which has already been answered, too simple, in the wrong section, or any of the other sins you regularly accuse us of...
I am printing a series of form letters which are selected on the basis of a couple of criteria. I want to exclude records with blank fields. (My database supports null values, but these field entries are blanks, not nulls. The fields are string (alphanumeric) values. My selection criteria (for the 1 month letter) are below. The first two criteria work fine; it is in the third line that I am trying to exclude the blank records. I have tried: {LetterEnt.Gr_LastName}<>"", {LetterEnt.Gr_LastName}<>" ", and then I got clever and tried the entry below. None of these work.
{LetterEnt.Letter1} = "X" and
{LetterEnt.Site} = "Q" and
Length({LetterEnt.Gr_LastName})>0+Message: AFAIK, if there are no records, there are no detail sections, so
your report must show text from other sections.+
(Is AFAIK some sort of "geek code" (in which case you have gone completely over my head), or are you addressing somebody by that name? (My name is David).)
If there are no records, there are indeed detail sections - with blank address fields. See my previous more detailed exposition of the exact nature of the problem.
+It is also not clear what "forces" a printout. Are you using Crystal
Designer (my assumption since you are posing in the Crystal Report Design
forum) or something else (Crystal Enterprise)? Crystal Designer doesn't
force printouts - a user must initiate the printout.+
Am I using Crystal Designer? I don't know. The program is called Crystal Reports XI in my computer. Are you suggesting that I am in fact asking my question in the wrong forum? (I would have presumed that something called "Crystal Reports Design" deals with design issues in Crystal Reports, but if I am in error, I do apologise. Perhaps you could direct me to the more appropriate resource.)
What "forces" a printout? You are correct insofar as the operator has to push the Print button (at least as presently functioning. At one stage I had the letters printing out behind the scenes using an Active-X control. This ran for 2 weeks, then fell apart and I eventually gave up trying to make it work; but that is another story.) How does this happen? Crystal is adding completely blank pages as the first page on some of the reports, so it is not always immediately apparent to the operator that there is a letter sitting there with a blank address. (And this, too, is a separate issue. I have gone through all the instructions in the knowledge base as to how to get rid of the leading blank sheet. None of the instructions have worked, and I eventually gave up trying. Thinking about it, I have had an awful lot of frustration with this program. Perhaps I am unreasonable, but if I can't get something to work after 3 or 4 hours' trying, I give it up as a bad job and live with the fault.)
+You can always suppress those other sections with a condition such as
IsNull({some field that is never Null).+
It is not clear to me what this means. All the sections other than the detail section are blank - always.
+There are 3rd-party Crystal Reports tools that allow you to skip
processing (printing/exporting/emailing) if the report comes up with zero
records.+
Aha! Am I interpreting this correctly, as saying that I cannot do what I want to do (suppress printing of letters with blank addresses) in Crystal Reports, and that to do this I need to get a third party add-on? -
How not to suppress printing grouping items
In group by reports, the printing of group items is suppressed until the values change. How can I get the report to not suppress printing the duplicates values?
In the select query , specify the group columns once more with alias names and make its frequncy below the grouped items..
Now your report will work as though you have not grouped it and also will return the group values..
For eg :
Select emp_code,emp_Dept ,emp_name, emp_dept dept_wise_emp
From employee_master
First group is emp_dept
Below level has rest of the columns..
Select the sum /count of the desired columns from the report wizard... -
Suppress printing the last two pages
I have created a form that has the last two pages of the form screen only visible. Saved the form and printed it but the last two pages print blank. Is there any way to suppress printing the last two blank pages. If I was the only person using the form I just wouldn't print the last two pages but this is going into a production environment where seeing the last two pages is important but printing the last two pages isn't.
Thanks.Take a look at the script produced by the "Print Button".
xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);
The doc for print is available at http://livedocs.adobe.com/livecycle/8.2/acrobat_designer/001735.html
Steve -
Allow buyer to suppress printing of item delivery schedule on PO
Gurus,
Is it possible to allow buyer to suppress printing of item delivery schedule on PO. If possible can you please propose me a solution.
Regardsnot with std config for PO creation but can be possible for PO changes
by seeting in the SPRO
MM-Purchasing-messages-fields relevant for printout changes
here u can do the settings for PO -
Suppress Print Dialogue while calling ADOBE FORM
Hi,
How to suppress the Print dialogue when I call PDF FORM.
In Smart form interface we have a field no_dialogue in the structure SSFCTRLOP to suppress print dialogue.
But in the Function Module generated by Adobe Form or in the Adobe Form Interface we don't have such structure to control the print dialogue.
awaiting the answers.
Ram.
Edited by: RamMohan Rao on Sep 17, 2008 7:29 PMHi,
Try to generate the interface and adobe form and also the generated FM "/1BCDWB/SAPLSM00000027"
Regards,
Srini. -
How to suppress printing blank pages?
Hi all,
I work with reports 6i and I need a tip.
I have to build a report with two sections (main and trailer section).The main section is always filled with data, but the trailer section does not always receive data.
When I print the report without data in the trailer section there is a blank last page. How can I suppress printing the trailer section when there is no data in it.
Thank you for your help.
ThomasHello,
You can test to use the parameter : BLANKPAGES
http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwrefex/cmdline/common/bld_blnkpgs.htm
Regards -
Suppress "Print ALV List" dialog.
HI All,
Is there a way of suppressing the "Print ALV List" dialog that is displayed when you print an alv using REUSE_ALV_BLOCK_LIST_DISPLAY. The is_print parameters does not contain any option, though there is a supress_dynpro option before the dialog is called, not sure how to set this is_print parameters.
Rgds,
James.Hi,
<li>You can not suppress print parameters popup screen using REUSE* function module. It comes thats it. I tried for longtime to suppress, could not pass
<li>But when you print classical reports you can suppress it.
REPORT ZTEST_NOTEPAD.
DATA:G_LAY TYPE PRI_PARAMS-PAART,
G_LINES TYPE PRI_PARAMS-LINCT,
G_COLS TYPE PRI_PARAMS-LINSZ,
G_VAL TYPE C.
DATA:W_PRIPAR TYPE PRI_PARAMS,
W_ARCPAR TYPE ARC_PARAMS.
PARAMETERS:
P_DATA(10) TYPE C.
START-OF-SELECTION.
G_LAY = 'X_65_132'.
G_LINES = 65.
G_COLS = 132.
"Read, determine, change spool print parameters and archive parameters
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
IN_ARCHIVE_PARAMETERS = W_ARCPAR
IN_PARAMETERS = W_PRIPAR
LAYOUT = G_LAY
LINE_COUNT = G_LINES
LINE_SIZE = G_COLS
NO_DIALOG = 'X'
IMPORTING
OUT_ARCHIVE_PARAMETERS = W_ARCPAR
OUT_PARAMETERS = W_PRIPAR
VALID = G_VAL.
IF G_VAL NE SPACE AND SY-SUBRC = 0.
W_PRIPAR-PRREL = SPACE.
W_PRIPAR-PRIMM = SPACE.
NEW-PAGE PRINT ON
NEW-SECTION
PARAMETERS W_PRIPAR
ARCHIVE PARAMETERS W_ARCPAR
NO DIALOG.
ENDIF.
WRITE 'Output in spool'.
NEW-PAGE PRINT OFF.
CALL FUNCTION 'ABAP4_COMMIT_WORK'.
DATA:TEXT TYPE STRING.
CONCATENATE 'Spool' SY-SPONO 'is generated' INTO TEXT SEPARATED BY SPACE.
MESSAGE TEXT TYPE 'S'.
Thanks
Venkat.O -
How to suppress print dialog box from popping up under a condition
Greetings...
There may be a better way to accomplish what I'm trying to do, so I'm open to outside-the-box suggestions.
I have a pretty simple page which lists a set of statuses and descriptions of each. The user can edit these status flags and their descriptions on the page as well. When I view the page in "printer friendly" mode, I see a nice simple report of what the statuses are and their descriptions. Everything works great so far.
In our work request system built in ApEx, there's a page where someone can view the details of a work request, including the current status. When someone clicks on the help of that item, what I'd love to do is simple show the "printer friendly" version the status page mentioned above in a pop up window. My problem is that the print dialog box automatically shows up when a page is displayed in "printer friendly" mode and I do not want this to happen in this case.
I see the javascript code in the Printer Friendly page template which causes the print dialog box to show up automatically, but I don't want to remove it in the template just for this one case. This would suppress the print dialog box on all "printer friendly" page views and the users are used to it showing up when they ask to print the page.
I guess I could create a custom request to pass to the master status page which would pretty much do everything that the "printer friendly" mode is doing, but that seems like a lot of work when I'm so close to using something that is built in.
Am I not seeing some simple other way of doing it or perhaps asking too much? Any suggestions?
Shane.Hi,
I think you have to call the FM GET_PRINT_PARAMETERS and pass NO_DIALOG = 'X'.
Something like:
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
no_dialog = 'X'
IMPORTING
out_parameters = ls_params
valid = lv_valid
EXCEPTIONS
OTHERS = 1.
NEW-PAGE PRINT ON PARAMETERS ls_params NO DIALOG.
* Display Table
lr_table->display( ).
add: Spool numbers can be found in TSP01 or in system field SY-SPONO available in the submitting program...
Hope it helps,
Kr,
m.
Edited by: Manu D'Haeyer on Sep 28, 2011 10:02 AM -
How to suppress printing of pages with no data
Dear all,
My report consists of 3 distinct sub reports. The first two sub reports should be printed as portrait on A-4 sheet while the third one should be printed as landscape A-4 . I have put the first two sub reports layout in the main section with orientation as portrait while the third one is placed in trailer section with orientation as landscape. The printing of subreports 2 and 3 is conditional. There may be case when first two sub reports get printed while we do not have third report as there is no data in the database for the same. In this case , I am still getting a blank page corresponding to the third sub report in the final report. How do I suppress this?
Regards,
Ranjit
P.S. I am using Reports 6imaybe, you don't understand me.
I have below jtable:
============================
I column1 name l column2 name I
============================
l data l data l
============================
l data l data l
============================
XXX
============================
I wrote:
table.setBackground(Color.black) then only data area has black colour, but XXX area hasn't black colour.
How to XXX area also has black colour?
help me, thanks very much. -
Printing ALV report by suppressing print dialog box
Hi,
I want to print a alv report by passing value in IS_PRINT export parameter which is working prefectly. But I want to suppress the dialog box which is appearing while printing and printing should go to spool directly is it possible.Hi,
You could try something like:
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
no_dialog = 'X'
IMPORTING
out_parameters = ls_params
valid = lv_valid
EXCEPTIONS
OTHERS = 1.
NEW-PAGE PRINT ON PARAMETERS ls_params NO DIALOG.
* Display Table
lr_table->display( ).
hope it helps,
Kr,
m. -
Download smartform as PDF, suppress Print/Preview dialog
Hi Experts,
Facing some issues in downloading PDF converted from Smartform.
In the program I am trying directly download a smartform converted into PDF format and save it in local system.
When ever I am trying to execute the program it shows up the Print/Preview dialog before showing the Save As dialog.
I have passed control_parameters-getotf = 'X' to the smartform runtime FM, which ideally should have suppressed the Print/Preview dialog and return the otfdata.
Here the entire code is...
Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code
The program other wise works absolutly fine .
Please advise.
Thanks
Jahan
Edited by: Rob Burbank on Apr 8, 2010 11:10 AMHelloo Guyz...
I am exactly trying the same, but the Print Dialog is still coming ...
See here is my code ..
cont_param-getotf = 'X'.
cont_param-no_dialog = 'X'.
cont_param-preview = 'X' .
CALL FUNCTION fm_name
EXPORTING
control_parameters = cont_param
IMPORTING
job_output_info = otfdata
TABLES
s_bukrs = s_bukrs[]
s_gjahr = s_gjahr[]
s_rebzg = s_rebzg[]
s_kunnr = s_kunnr[]
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
even after this ..during execution the the Print Dialog is coming..
I have no idea what esle I am missing..
Thanks -
Suppress PRINT ACKNOWLEDGE browser page.
Hi,
I am able to direct print the reports on web using normal parameters...i.e. desname, destype and desformat.
When it prints successfully, it gives us a message in a separate browser window "The report has been successfully printed out"
And we don't want this message. Can anybody tell me to suppress this window and message ? ?
Thanks,Chintan,
Are you using 6i server and CGI or 9i server and servlet.
Try starting the server in batc mode ( batch =yes)
Thanks
Rajesh -
Suppressing printing of blank page
Dear all,
My report consists of 3 distinct sub reports. The first two sub reports should be printed as portrait on A-4 sheet while the third one should be printed as landscape A-4 . I have put the first two sub reports layout in the main section with orientation as portrait while the third one is placed in trailer section with orientation as landscape. The printing of subreports 2 and 3 is conditional. There may be case when first two sub reports get printed while we do not have third report as there is no data in the database for the same. In this case , I am still getting a blank page corresponding to the third sub report in the final report. How do I suppress this?
Regards,
RanjitHey dareys,
Per PCWIZARD's suggestion in another thread,
It may be the printer's power supply is dropping the power to the printer when it is off. You can reset the power supply by unplugging it from both the wall and the printer for 5 minutes.
Help the community by marking this post as a solution if it solved your issue!.
If my post helped you in any way, please click the blue KUDOS star under my name! It would mean a great deal. -
Reg: Suppress Print popup while printing ALV
Hi Experts,
I am using FM REUSE_ALV_LIST_DISPLAY to print the report and convert the spool to PDF and email it as attachment.
When iam calling the FM for printing by passing parameter IS_PRINT, it is asking me to enter printer details as popup. I need to suppress this popup. I tried passing the default print parameters to this IS_PRINT, but still no result.
Can anyone help me on this.
Thanks
NaveenHi
You need to pass first ALV data to spool and a PDF doc as email and then again call the FM grid display .
Clear Spool Number
CLEAR: gv_spool.
Check for presence of any recipients
IF s_reclst[] IS NOT INITIAL.
sy-batch = 'X'. "#EC WRITE_OK
gs_alv_print-print = 'X'.
gs_alv_print-prnt_info = ' '.
gs_alv_print-no_print_selinfos = 'X'.
gs_alv_print-no_print_listinfos = 'X'.
gs_alv_print-no_coverpage = 'X'.
gs_alv_print-reserve_lines = 1.
gs_alv_print-print_ctrl-pri_params-pdest = 'PRINTER'.
gs_alv_print-print_ctrl-pri_params-primm = 'X'.
CALL FUNCTION 'REUSE_ALV_list_DISPLAY'
EXPORTING
i_callback_program = gv_repid
is_layout = gs_alv_layout
is_variant = gs_alv_variant
it_fieldcat = gt_alv_fieldcat
it_sort = gt_alv_sort
it_events = gt_alv_events
is_print = gs_alv_print
TABLES
t_outtab = gt_final[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Get the Spoolnumber
gv_spool = sy-spono.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gv_spool
TABLES
pdf = gt_pdf_output
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
Transfer the 132-long strings to 255-long strings
LOOP AT gt_pdf_output INTO gs_pdf_output.
TRANSLATE gs_pdf_output USING ' ~'.
CONCATENATE gt_buffer gs_pdf_output INTO gt_buffer.
ENDLOOP.
TRANSLATE gt_buffer USING '~ '.
DO.
gs_objtxt = gt_buffer.
APPEND gs_objtxt TO gt_objtxt.
SHIFT gt_buffer LEFT BY 255 PLACES.
IF gt_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDIF.
ENDIF.
the above code will help you.
Thanks
kishore
Maybe you are looking for
-
MY touch will not come on all of a sudden, but when i plug it in it has to boot up and will shut itself down. i have rebooted it to factroy settings and reloaded back up from itunes but still will not work. does anyone have an ideal what would have c
-
MM Experts, Is there a report like ME2K, that will contain the requisitioner and the Long PO text at the item level? I also looked into ME5K where I get the requisitioner but I get no PO net Amount. Are there any more robust reports? or how can I do
-
I can't synchronize my movies. What is the video size for ipad2?
I can't synchronize my movies in my IPad 2. What is the video size for ipad2?
-
I'm considering getting an esata expresscard to use with external hdd, and was wondering how peoples experiences were. I've looked on the forums and many people mention them, however there aren't any recent posts - so I wanted to check to see if anyt
-
Measure to dynamically change based on prompt selection
Hi Experts, My requirement is, if I select a business segment (from a drop down prompt), it has show one of measure in the report and if I change the prompt value, it has to show a different measure. i.e., It should work like a column selector, but m