Reports 6i Pdf generation problems
Hi,
I am using reports 6i with graphics. when I see the report inside the previewer the vertical tick marks on the X-axis appear fine, but when I generate to PDF the same tick marks appear inverted which can only be seen with the help of a mirror.
I would appreciate any help.
Paras
Paras,
Looks strange and interesting. Hope you have a mirror with you always now.
Well. We have not come across this problem and not been able to reproduce also
You can try generating to a eps file and convert it to PDF using Acrobat distiller and see how it comes out.
You can log a TAR through Oracle metalink if you have a reproducible testcase
Thanks
The Oracle Reports team
Similar Messages
-
Help: PDF Generation Problems in Reports 3.0
Hi Techies,
We are generating PDFs from Oracle Reports 3.0
The PDF generation is fine in some datbases.
But in some database,when the records are more, during PDF
generation, Dr.Watson error is encountered, saying access
violation.
Can any one please clarify whether the error is due to memory
constraints on the system or if it has something to do with
Oracle Reports setting, while generating PDFs.
Do note that the reports are running fine, when the report has
less number of records.
Any suggestion/tip is awaited at the earliest.
Thanks in advance,
Geoff
nullHi!
Remove cache from output dir from time time.
(i.e. from virtual dir where report server puts output)
let me know ...
later
Geoff (guest) wrote:
: Hi Techies,
: We are generating PDFs from Oracle Reports 3.0
: The PDF generation is fine in some datbases.
: But in some database,when the records are more, during PDF
: generation, Dr.Watson error is encountered, saying access
: violation.
: Can any one please clarify whether the error is due to memory
: constraints on the system or if it has something to do with
: Oracle Reports setting, while generating PDFs.
: Do note that the reports are running fine, when the report has
: less number of records.
: Any suggestion/tip is awaited at the earliest.
: Thanks in advance,
: Geoff
null -
PDF Generation problems in Reports 3.0
Hi,
I am generating PDFs from Oracle Reports 3.0
The PDF generation is fine in some datbases.
But in some database,when the records are more, during PDF
generation, Dr.Watson error is encountered, saying access
violation.
Can any one please clarify whether the error is due to memory
constraints on the system or if it has something to do with
Oracle Reports setting, while generating PDFs.
Do note that the reports are running fine, when the report has
less number of records.
Any help in this matter is appreciated.
Regards,
PRAKASH
nullHi!
Remove cache from output dir from time time.
(i.e. from virtual dir where report server puts output)
let me know ...
later
Geoff (guest) wrote:
: Hi Techies,
: We are generating PDFs from Oracle Reports 3.0
: The PDF generation is fine in some datbases.
: But in some database,when the records are more, during PDF
: generation, Dr.Watson error is encountered, saying access
: violation.
: Can any one please clarify whether the error is due to memory
: constraints on the system or if it has something to do with
: Oracle Reports setting, while generating PDFs.
: Do note that the reports are running fine, when the report has
: less number of records.
: Any suggestion/tip is awaited at the earliest.
: Thanks in advance,
: Geoff
null -
APEX 4.1 - APACHE FOP PDF generation problem.
Hi all,
I'm having problem with PDF generation using APACH FOP on OC4J.
When I test my print server as described here:
http://marcsewtz.blogspot.com/2008/06/heres-another-posting-on-pdf-printing.html
everything works without problem. But when I upload my Layout to APEX and try to generate PDF from apex I'm getting error:
oracle.xml.parser.v2.XMLParseException: Unexpected EOF.
at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:320)
at oracle.xml.parser.v2.XMLReader.popXMLReader(XMLReader.java:549)
at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1375)
at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:362)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:308)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:337)
at oracle.xml.xslt.XSLProcessor.newXSLStylesheet(XSLProcessor.java:714)
at oracle.xml.xslt.XSLStylesheet.<init>(XSLStylesheet.java:322)
at oracle.xml.parser.v2.XSLStylesheet.<init>(XSLStylesheet.java:114)
at apex_fop._jspService(_apex__fop.java:71)
[SRC:/apex_fop.jsp:21]
I could see similar post here:
Handling Special characters in call to apex_util.download_print_document
But it doesn't explain my case as it's crashing even when I generate empty pdf(no data so no special characters, only empty XML file with no data should be sent to print server)
Is there any way to see what xml is sent do print server for processing? That could eventually show where is a problem.
PaloMy mistake, there was really an "&" character in my template. now when I replaced it with %26 it works.
However I would be still interested if there is a way to see what data is APEX engine sending to print server cause it will help me to find this kind of errors.
Palo -
Hello ,
I have a web application that turn on Websphere 6.1. Since I haven't migrate my windows server from 2000 to 2003, no problem appeared when I try to generate and display my pdf trought my web browser.
But since the migration , the pdf is not displyed in the web browser but i have a pop-up that explains me that the file could not be open by .. my pdf reader because the file seems to have a problem and it ask me if I want to download it , afterr the download the file can be open without any problem.
Any suggestion about this issue ?
Thanks a lot ...
Please find the extract of the code :
ReportExportControl exportControl = new ReportExportControl();
exportControl.setName("ExportControl");
exportControl.setExportAsAttachment(false);
ExportOptions exportOptions = new ExportOptions(); //Set export options and format.
exportOptions.setExportFormatType(ReportExportFormat.PDF); //Set the format for the export options
exportControl.setExportOptions( exportOptions ); //set the exportOptions to the viewer
//Obtain report source of the report that the exportControl will display.
Object reportSource = request.getSession().getAttribute("reportSource");
exportControl.setReportSource(reportSource);
//exportControl.setParameterFields(fields);
exportControl.setEnableParameterPrompt(false);
exportControl.setEnableLogonPrompt(false);
exportControl.setOwnPage(true);
exportControl.setOwnForm(true);
if (request.getSession().getAttribute("refreshedExport") == null) {
exportControl.refresh();
request.getSession().setAttribute("refreshedExport", "true");
exportControl.processHttpRequest(request, response, getServletConfig().getServletContext(), null);You can find steps to resolve the issue on this document http://kb2.adobe.com/cps/328/328791.html.
-
RH PDF generation problems: wrong (A4) page size and Word 2013
I am trying to generate a review PDF of a handful or topics. It generates, but first I get an error:
(I have Word 2013 installed.)
Then the PDF generates, but it is A4. I never use metric for anything, so where it is picking up A4 I can't imagine. I have all my PDF settings to letter. I checked Edit > Properties > PDF settings > Advanced settings, everything. It's all set correctly. Even all of my Word templates (which I am not using for this project anyway) are letter. Like I said: No metric pages or units of measure used ever. Not in Word, not in FrameMaker, not in Acrobat. Why does RoboHelp default to A4?
And why does it not consider Word 2013 "newer" than Word 2000?Word 2013 is not supported by any version of Rh. The first part is correct so Rh throws the error message notwithstanding the second part is wrong.
You haven't mentioned the version of Rh you are using (please see the forum sticky topics) but you might find you can right click Properties in the print layout and generate to Word there. Using that route you may find the answer to the A4 issue. I'm puzzled by that as normally Rh defaults to Letter.
Are you using the PDF add-on or a full version of Acrobat, if the latter which one?
See www.grainge.org for RoboHelp and Authoring tips
@petergrainge -
All,
I have some reports, whose PDF generation doesn't satisfy our requirements. A simple BO report page with a few sections.. ends up as a multiple page PDF. I had tried to also use the report/section properties as creatively as possible too.
I would like to get some information about if some-one has done PDF generation using SDK and if that provides more feature-rich formatting options?
Would appreciate your comments and advice.
RegardsLet's start with what version of CR / BO you are working with.
What SPs have you applied?
What version of .NET do you want to work with? What SDK do you want to work with (CR, RAS, BO)?
Are you doing these exports in the CR designer? - If so, have you consulted with the CR Design team on best way to design these reports? Typically, if you can not do something in the desinger, you more than likely can not do it from code either...
Ludek -
PDF reports generation problem from single oracle reports in 10G
Hi All,
i am generating 4 PDF reports from one Oracle reports in 10 G.
i used RUN_REPORT_OBJECT built in 4 times with some different parameter list at a single time.
some time it generates but some time it generate 2 or 3 out of 4.
Can you anyone help me on this issue.
Regards,
Abhishek
Code that i used for generation of report:
on key-F0:
DECLARE
PL_ID PARAMLIST;
PL_NAME VARCHAR2(10) := 'REP';
USRNM VARCHAR2(50);
pl_id2 paramlist;
pl_name2 varchar2(10):= 'REP';
usrnm2 varchar2(50);
pl_id3 paramlist;
pl_name3 varchar2(10):= 'REP';
usrnm3 varchar2(50);
pl_id4 paramlist;
pl_name4 varchar2(10):= 'REP';
usrnm4 varchar2(50);
BEGIN
USRNM := GET_APPLICATION_PROPERTY(USERNAME);
PL_ID := GET_PARAMETER_LIST(PL_NAME);
IF NOT ID_NULL(PL_ID) THEN
DESTROY_PARAMETER_LIST(PL_ID);
END IF;
PL_ID := CREATE_PARAMETER_LIST(PL_NAME);
IF ID_NULL(PL_ID) THEN
MESSAGE('Error Creating Parameter List ');
END IF;
ADD_PARAMETER(PL_ID, 'P_PRNT_C_FAM_ID', TEXT_PARAMETER, :PRNT_C_FAM_ID);
ADD_PARAMETER(PL_ID, 'P_NOTICE_DATE', TEXT_PARAMETER, TO_CHAR(:FRONT_END.NOTICE_DATE,'MM/DD/RRRR'));
ADD_PARAMETER(PL_ID, 'P_REDET_DATE', TEXT_PARAMETER, TO_CHAR(:FRONT_END.REDET_DATE,'MM/DD/RRRR'));
ADD_PARAMETER(PL_ID, 'USR_NM', TEXT_PARAMETER, USRNM);
ADD_PARAMETER(PL_ID, 'SCHEDULE', TEXT_PARAMETER, :RUN_TIME);
ADD_PARAMETER(PL_ID,'P_PRNT_PROV',TEXT_PARAMETER,'PRNT');
ADD_PARAMETER(PL_ID, 'P_ENG_SP', TEXT_PARAMETER,'N');
REDET_REPORT('506',PL_ID,'CT506_Parent_FamId_Eng'||To_Char(sysdate,'MMDDRRRR-HHMISS'));
USRNM2 := GET_APPLICATION_PROPERTY(USERNAME);
PL_ID2 := GET_PARAMETER_LIST(PL_NAME2);
IF NOT ID_NULL(PL_ID2) THEN
DESTROY_PARAMETER_LIST(PL_ID2);
END IF;
PL_ID2 := CREATE_PARAMETER_LIST(PL_NAME2);
IF ID_NULL(PL_ID2) THEN
MESSAGE('Error Creating Parameter List');
END IF;
ADD_PARAMETER(PL_ID2,'P_PRNT_C_FAM_ID',TEXT_PARAMETER,:PRNT_C_FAM_ID);
ADD_PARAMETER(PL_ID2,'P_NOTICE_DATE',TEXT_PARAMETER,TO_CHAR(:FRONT_END.NOTICE_DATE,'MM/DD/RRRR'));
ADD_PARAMETER(PL_ID2,'P_REDET_DATE',TEXT_PARAMETER,TO_CHAR(:FRONT_END.REDET_DATE,'MM/DD/RRRR'));
ADD_PARAMETER(PL_ID2,'USR_NM',TEXT_PARAMETER,USRNM2);
ADD_PARAMETER(PL_ID2,'SCHEDULE',TEXT_PARAMETER,:RUN_TIME);
ADD_PARAMETER(PL_ID2,'P_PRNT_PROV',TEXT_PARAMETER,'PRNT');
ADD_PARAMETER(PL_ID2,'P_ENG_SP',TEXT_PARAMETER,'Y');
REDET_REPORT('506',PL_ID2,'CT506_Parent_FamId_Sp'||To_Char(sysdate,'MMDDRRRR-HHMISS'));
USRNM3 := GET_APPLICATION_PROPERTY(USERNAME);
PL_ID3 := GET_PARAMETER_LIST(PL_NAME3);
IF NOT ID_NULL(PL_ID3) THEN
DESTROY_PARAMETER_LIST(PL_ID3);
END IF;
PL_ID3 := CREATE_PARAMETER_LIST(PL_NAME3);
IF ID_NULL(PL_ID3) THEN
MESSAGE('Error Creating Parameter List');
END IF;
ADD_PARAMETER(PL_ID3,'P_PRNT_C_FAM_ID',TEXT_PARAMETER,:PRNT_C_FAM_ID);
ADD_PARAMETER(PL_ID3,'P_NOTICE_DATE',TEXT_PARAMETER,TO_CHAR(:FRONT_END.NOTICE_DATE,'MM/DD/RRRR'));
ADD_PARAMETER(PL_ID3,'P_REDET_DATE',TEXT_PARAMETER,TO_CHAR(:FRONT_END.REDET_DATE,'MM/DD/RRRR'));
ADD_PARAMETER(PL_ID3,'USR_NM',TEXT_PARAMETER,USRNM3);
ADD_PARAMETER(PL_ID3,'SCHEDULE',TEXT_PARAMETER,:RUN_TIME);
ADD_PARAMETER(PL_ID3,'P_PRNT_PROV',TEXT_PARAMETER,'PROV');
ADD_PARAMETER(PL_ID3,'P_ENG_SP',TEXT_PARAMETER,'N');
REDET_REPORT('506',PL_ID3,'CT506_Prov_ProvId_Eng'||To_Char(sysdate,'MMDDRRRR-HHMISS'));
USRNM4 := GET_APPLICATION_PROPERTY(USERNAME);
PL_ID4 := GET_PARAMETER_LIST(PL_NAME4);
IF NOT ID_NULL(PL_ID4) THEN
DESTROY_PARAMETER_LIST(PL_ID4);
END IF;
PL_ID4 := CREATE_PARAMETER_LIST(PL_NAME4);
IF ID_NULL(PL_ID4) THEN
MESSAGE('Error Creating Parameter List');
END IF;
ADD_PARAMETER(PL_ID4,'P_PRNT_C_FAM_ID',TEXT_PARAMETER,:PRNT_C_FAM_ID);
ADD_PARAMETER(PL_ID4,'P_NOTICE_DATE',TEXT_PARAMETER,TO_CHAR(:FRONT_END.NOTICE_DATE,'MM/DD/RRRR'));
ADD_PARAMETER(PL_ID4,'P_REDET_DATE',TEXT_PARAMETER,TO_CHAR(:FRONT_END.REDET_DATE,'MM/DD/RRRR'));
ADD_PARAMETER(PL_ID4,'USR_NM',TEXT_PARAMETER,USRNM4);
ADD_PARAMETER(PL_ID4,'SCHEDULE',TEXT_PARAMETER,:RUN_TIME);
ADD_PARAMETER(PL_ID4,'P_PRNT_PROV',TEXT_PARAMETER,'PROV');
ADD_PARAMETER(PL_ID4,'P_ENG_SP',TEXT_PARAMETER,'Y');
REDET_REPORT('506',PL_ID4,'CT506_Prov_ProvId_Sp'||To_Char(sysdate,'MMDDRRRR-HHMISS'));
Message('Notice Submitted For Printing');
EXIT_FORM;
END;
Program unit:
PROCEDURE REDET_REPORT(rep_name in Varchar2,plist in ParamList,rep_pdf_name in Varchar2)IS
filecode varchar(2);
Repnm varchar(30);
report_id REPORT_OBJECT;
report_id_hear REPORT_OBJECT;
report_prop VARCHAR2(20);
v_rep VARCHAR2(100);
rep_status VARCHAR2(200);
bat_loc varchar2(200);
time_slot varchar2(100);
rep_folder_name varchar2(100):='Redet Notice for Packets Sent\';
BEGIN
Filecode := init.GetFileNmCode;
if filecode 'FL' then
if upper(substr(rep_name,1,2)) ='CC' then
RepNm := filecode||substr(rep_name,3);
else
if rep_name != 'viewerr' then
RepNm := filecode||rep_name;
else
RepNm := rep_name;
end if;
end if;
end if;
Begin
begin
report_id := find_report_object(RepNm);
if error_code = '41219' then
Message('Unable to execute : '|| RepNm);
Raise FORM_TRIGGER_FAILURE;
end if;
end;
set_report_object_property(report_id, REPORT_FILENAME, RepNm);
set_report_object_property(report_id, REPORT_SERVER, init.Appl_Repserver);
SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_EXECUTION_MODE, BATCH);
SET_REPORT_OBJECT_PROPERTY(report_id, REPORT_COMM_MODE,SYNCHRONOUS);
set_report_object_property(report_id, REPORT_DESFORMAT,'PDF');
select rprm_param_val||rep_folder_name||rep_pdf_name||'.pdf' into bat_loc from rprm where rprm_param_name = 'BAT_LOC';
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,FILE);
SET_REPORT_OBJECT_PROPERTY(REPORT_ID,REPORT_DESNAME,'"'||bat_loc||'"');
begin
v_rep := RUN_REPORT_OBJECT(report_id,plist);
exception when others then
Message('Error While executing running reports ::'||error_code);
end;
end;
END;Thanx Frank
Well one solution is that i can decrease the length of my report name and the problem does not occur than.
any ways thanx ..but where to get the patch from.
Kindly provide me with the link if possible.
Thanx,
Qaiser Qayyum Malik.
[email protected] -
Problem to export a report (to PDF) after converting my reports to CR13
I have an old project with reports developped using Crystal Reports for Visual Studio 2003 (.NET 1.1). I want to convert them so I can now use Crystal Reports for Visual Studio 2010 (with .NET 3.5).
I installed Crystal Reports for VS2010 and I converted my reports to the new format. Unfortunately, one of my reports is not working anymore.
My ASP.NET application generate the report and export it as a PDF. I use CrystalDecisions.CrystalReports.Engine.ReportDocument.Export().
Everytime I run this method, an exception is thrown...
System.Exception was unhandled by user code
Message=System.Runtime.InteropServices.COMException (0x80041004):
Mémoire insuffisante pour l'opération.
à CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
à CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
à CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
à CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
à CrystalDecisions.CrystalReports.Engine.FormatEngine.Export()
à CrystalDecisions.CrystalReports.Engine.ReportDocument.Export()
à
Source=GSPRapport
StackTrace:
I also tried to export the report (using PDF format) at design time with the "Export Report" button in Preview mode. It didn't work. But, I can export the report at design time using another format type (like XML).
The old version of te report (using .NET 1.1, CR9) work fine. As I said, other reports in that same project work perfectly.
Is someone have an idea of what's wrong!
Thanks!
Max.The most common cause of this problem is having very large detailed images, or lots and lots of images in your report. The Crystal Report engine changed a lot from 9.1 to 13. The big change was from 9.1 to 10 though when we started using the RAS InProc engine.
The Crystal reporting engine is not efficient at handling the images and it can cause memory issues like you are seeing. As a test, try suppressing the images that show up frequently in your report and retry your export. If it works you'll have your answer and you'll need a new creative way to design your report without so many images. -
A big problem of Generate report with PDF format....Urgent
I want to generate a report with pdf format through one java file, it have two page 1)gen_report.jsp 2) report_gen.java , the compliation was failed. However, i don't what the problem is .... i hope anyone can help me as it is very argent for me ....Thanks a lot
1)gen_report.jsp
<table id="AutoNumber1">
<tr>
<td background="images/top5movie.png">
<p align="center"> </p>
</td>
</tr>
<tr>
<td >
<div align="center">
<table id="AutoNumber2" >
<form method="GET" action="../report_gen" name="report_gen" target="_blank" onSubmit="javascript:return checkr1(this)">
<tr>
<td ><b>Report Description:</b></td>
<td >This report is to show the top five popular movies in cinemix for a period </td>
</tr>
<tr>
<td><b>Data scope:</b></td>
<td >Start from
<input type="text" name="start" value="2003-1-1" >to
<input type="text" name="end" value="2006-1-1" ></td>
</tr>
<tr>
<td><b>Data processing:</b></td>
<td >Show
<select name="order_by">
<option value="desc" selected>top</option>
<option value="asc">bottom</option>
</select>
5 films</td>
</tr>
<tr>
<td> <p align="center">
<input type="submit" value="View_Report" name="subm">
</p></td>
</tr>
<input type="hidden" name="report" value="r1">
</form>
<form method="GET" action="../report_gen" name="report_gen" target="_blank" onSubmit="javascript:return checkr2(this)">
<input type="hidden" name="report" value="r2">
</form>
</table>
</div>
</td>
</tr>
</table>Then my java code is here
report_gen.java
import java.io.*;
import java.net.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.sql.*;
// chart and pdf out
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.data.xy.*;
import org.jfree.data.xy.XYBarDataset;
import org.jfree.data.general.DefaultPieDataset;
import org.jfree.data.statistics.SimpleHistogramDataset;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Rectangle;
import com.lowagie.text.pdf.DefaultFontMapper;
import com.lowagie.text.pdf.PdfContentByte;
import com.lowagie.text.pdf.PdfTemplate;
import com.lowagie.text.pdf.PdfWriter;
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
import com.lowagie.text.pdf.PdfPCell;
public class report_gen extends HttpServlet
private final String titles[] = {"Top Five popular movies ",
"Financial cirumstance of cinemas",
"Distribution of time segment",
"Distribution of favourite movie type"
private final String descs[] = {"This report is to show the top five popular movies in cinemix for a period ",
"This report is to show the financial circumstance of each cinema site ",
"This report is to analysis the customer when is the most visit time ",
"This report is to analysis the customer which type of movie do they watch the most"
private final String bigTitle = "Cinemix";
private final String driver = "org.gjt.mm.mysql.Driver";
private final String url= "jdbc:mysql://localhost:3306/cinemix";
private final String userID = "abc";
private final String passwd = "abc";
public void init(ServletConfig config) throws ServletException
super.init(config);
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
final int width = 550;
final int height = 200;
/ title font (centre and report title)
final Font fTitle0 = FontFactory.getFont("Helvetica", 42, Font.BOLD);
final Font fTitle1 = FontFactory.getFont("Helvetica", 30, Font.BOLD);
// centre name:
final String title0 = bigTitle;
// Default category for DefaultCategoryDataset
final String cat = "data";
Connection conn;
JFreeChart chart;
String title1 = "xyz Report";
String chartDesc = "description";
String notes[] = new String[4];
String chartTitle = "so bad this is title";
String chartXTitle = "this is x";
String chartYTitle = "this is y.";
String report = request.getParameter("report");
int max=-10000;
int min=10000;
int j=0;
// do some basic checking
if (report == null || report.equals(""))
report = "-1"; // this course unknow report error message
String start = request.getParameter("start");
String end = request.getParameter("end");
String order_by = request.getParameter("order_by"); // ToDo: check invalid string
int topN = 5;
String order = (order_by.equals("desc")) ? "Top" : "Last";
String inv[] = {"08:30", "09:30", "10:30", "11:30", "12:30", "11:30", "12:30", "13:30", "14:30", "15:30", "16:30", "17:30","18:30","19:30","20:30","21:30","22:30","23:30"};
int inv_val[] = new int[inv.length - 1];
try
Class.forName(driver).newInstance();
catch(Exception e)
printE("Cannot load mysql database driver!", response);
e.printStackTrace();
return;
try
conn = DriverManager.getConnection(url, userID, passwd);
if (report.equals("r1")) { // report 1
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
Statement stmt = conn.createStatement();
String sql = "select *,count(f.Name),f.Name from film f, filmDetail fd, ticket t where f.startDate > '" + start + "' and f.endDate < '" + end + "'and fd.filmID = f.filmID and fd.filmDetailID = t.filmDetailID group by f.name order by fd.filmDetailID asc limit '" +topN+"'";
ResultSet rs = stmt.executeQuery(sql);
while (rs.next())
if (rs.getInt("fd.filmDetailID") > max) max = rs.getInt("fd.filmDetailID");
if (rs.getInt("fd.filmDetailID") < min) min = rs.getInt("fd.filmDetailID");
j++;
ataset.setValue(rs.getInt("fd.filmDetailID"), cat,rs.getString("f.Name"));
title1 = titles[0];
chartDesc = descs[0];
chartTitle = order + " " + topN + " popular movie";
chartYTitle = "Box Office record";
chartXTitle = "Film Name";
gender = " ";
chart = ChartFactory.createBarChart(chartTitle, chartXTitle, chartYTitle, dataset,PlotOrientation.VERTICAL, false, true, false);
else
print("Error: I don't inderstand your request!", response);
return;
catch (SQLException e)
printE("Cannot open database connection? <br>", response);
// printE(e.toString);
e.printStackTrace();
return;
response.setContentType("application/pdf");
Document document = new Document(PageSize.A4, 5, 5, 5, 5);
try
PdfWriter writer;
writer = PdfWriter.getInstance(document, response.getOutputStream());
HeaderFooter footer = new HeaderFooter(new Phrase("Page: "), true);
footer.setBorder(Rectangle.NO_BORDER);
document.setFooter(footer);
footer.setAlignment(Element.ALIGN_CENTER);
// step 3
document.open();
document.add(getHeader(title0, title1, start, end, gender, order, topN, chartDesc));
document.add(printChart(chart, writer));
document.add(getFooter(notes));
catch(DocumentException de)
de.printStackTrace();
// step 5
document.close();
return;
}// end doGet()
/** Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
// processRequest(request, response);
/** Returns a short description of the servlet.
public String getServletInfo()
return "Generate reports for " + bigTitle;
/* To print en error and exit(?) */
private void printE(Object obj, HttpServletResponse response) throws IOException
response.setContentType("text/html");
PrintWriter out;
out = response.getWriter();
out.print(obj.toString());
out.close();
// To-Do: how to force exiting?
// create data chart
private PdfPTable getHeader(String title0, String title1, String start, String end, String sex, String order, int topN, String desc)
Font fTitle0 = FontFactory.getFont("Helvetica", 42, Font.BOLD);
Font fTitle1 = FontFactory.getFont("Helvetica", 24, Font.BOLD);
Font fTitle3 = FontFactory.getFont("Helvetica", 12, Font.BOLD);
Font fValue = FontFactory.getFont("Helvetica", 12, Font.UNDERLINE);
Paragraph parStartEnd = new Paragraph();
parStartEnd.add(new Phrase("Data start from: ", fTitle3));
parStartEnd.add(new Phrase(start, fValue));
parStartEnd.add(new Phrase(" to ", fTitle3));
parStartEnd.add(new Phrase(end, fValue));
Paragraph parGenerateDate = new Paragraph();
parGenerateDate.add(new Phrase("Report generated at: ", fTitle3));
parGenerateDate.add(new Phrase(new java.util.Date().toString(), fValue));
Paragraph parGender = new Paragraph();
parGender.add(new Phrase("Current show gender: ", fTitle3));
parGender.add(new Phrase(sex, fValue));
Paragraph parTopN = new Paragraph();
parTopN.add(new Phrase("Now is showing ", fTitle3));
parTopN.add(new Phrase(order, fValue));
parTopN.add(new Phrase(" ", fValue));
parTopN.add(new Phrase(new Integer(topN).toString(), fValue));
parTopN.add(new Phrase(" record(s)", fTitle3));
// Start main table
PdfPTable tblMain = new PdfPTable(1);
tblMain.getDefaultCell().setBorder(0);
// Print title
tblMain.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
tblMain.addCell(new Paragraph(title0, fTitle0));
tblMain.addCell(new Paragraph(title1, fTitle1));
tblMain.addCell("");
tblMain.addCell("");
tblMain.addCell("");
// Print headers data
//tblMain.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
//tblMain.addCell(parInvoiceNum);
//tblMain.addCell("");
tblMain.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
tblMain.addCell(parStartEnd);
tblMain.addCell("");
tblMain.addCell(parGenerateDate);
tblMain.addCell("");
if (sex != " ")
tblMain.addCell(parGender);
else if(order != null && topN > 0)
tblMain.addCell(parTopN);
else
tblMain.addCell(" \n");
tblMain.addCell("");
tblMain.setWidthPercentage(96);
tblMain.addCell(new Paragraph("Description of this report:", fTitle3));
tblMain.addCell(desc);
tblMain.addCell("\n");
// Finish main table
return tblMain;
// print a chart _directly_ to pdf and return a empty Pdftable...
public PdfPTable printChart(JFreeChart chart, PdfWriter writer)
PdfContentByte cb = writer.getDirectContent();
int width = 550;
int height = 450;
PdfTemplate tp = cb.createTemplate(width, height);
Graphics2D g2d = tp.createGraphics(width, height, new DefaultFontMapper());
Rectangle2D r2d = new Rectangle2D.Double(0, 0, width, height); //->,
chart.draw(g2d, r2d);
g2d.dispose();
cb.addTemplate(tp, 20, 170);
// quick method to push down the footer text
// the only things this method return
PdfPTable tblDownDown = new PdfPTable(1);
tblDownDown.getDefaultCell().setBorder(0);
tblDownDown.addCell(" \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n");
tblDownDown.addCell(" \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n");
tblDownDown.addCell(" \n \n \n \n \n \n");
return tblDownDown;
public PdfPTable getFooter(String notes[])
Font fNote = FontFactory.getFont("Helvetica", 14, Font.UNDERLINE);
Font fComment = FontFactory.getFont("Helvetica", 12, Font.ITALIC);
Font fTitle1 = FontFactory.getFont("Helvetica", 30, Font.ITALIC);
// Start footer table
PdfPTable tblFooter = new PdfPTable(1);
tblFooter.getDefaultCell().setBorder(0);
if (notes != null)
tblFooter.addCell(new Paragraph("Notes:", fNote));
tblFooter.addCell("");
tblFooter.addCell("");
tblFooter.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
for (int i=0;i<notes.length;i++)
if (notes[i] != null)
tblFooter.addCell(new Paragraph("" + (i+1) + ". " + notes[i] + "", fComment));
tblFooter.addCell("");
tblFooter.addCell("");
tblFooter.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
tblFooter.addCell(new Paragraph("- End of report -", fComment));
return tblFooter;
}Go to the cache directory and see if you can open the report directly from here (not in IE).
I have seen posts on problems with Acrobat Reader Plugin for IE (I believe it was version 6 of Reader). -
Problem in converting reports to PDF format - bug
dear all,
There is a problem in converting the reports in PDF format.
The situation is that if we use the tool bar icon in SAP B1 to get the reports in PDF format, there are printing errors. The output PDF file does not contain the exact data that is in the report, the values are getting interchanged and mismatched.
But if we do the same using the print in the PDF option in choose from printers window as we do regular pringting, the document is printed properly.
what may be the cause for this bug like thing. How can we solve it??
please help me..
thanks and regards,
Yeshwanth PrakashCheck this SAP Note: 1089388 Incorrect value in exported PDF when Concat function is used
[https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/smb_searchnotes/display.htm?note_langu=E¬e_numm=1089388] -
Report with PDF format in IExplorer problem
report with PDF format in IExplorer problem
Hi,
when i make the desformat=PDF it gave me error
"file does not start with '%PDF' " in the IExplorer despite i have updated version of Acrobat reader and IE.
I'm using this URL:
http://bss9i.stc.com.sa:7779/reports/rwservlet?destype=SCREEN&desformat=PDF&report=CR1.rdf&userid=webcr/webcr1@cr&p_cr='AP/63'.
Any suggestion is greatly appreciated.
Thanks.
Kamal KhafagyShouldn't destype be CACHE?
-
Crystal Reports PDF Export problem
Hi I'm using Crystal 8.5 for my reports in VB 6.0. We have intrepret as RTF in the report. Now when we export this report to PDF the nested bullets loose formatting. All bullets show up at the same level. Any idea how to fix this?
Thanks
SudhaHello Ingo,
thanks a lot for Your help. I have already talked to my IT department and they are looking for the solution of this problem, too.
Is there a documentation about necessary settings in the browser to work with SAP NetWeaver Portal and Crystal reports?
The problem is that on some clients the PDF export is working and on another clients not. The settings of IE seem to be equal.
Regards,
Katharina -
Hi there,
Our company uses Colffusion to make PDFs for our client.
Recently, the PDF generation is incredible instable, causing
corrupt PDF files or performance issues.
I found out, that the problem lies within the including some
picture. This slows down almost everything or sometimes the
generation does not happen at all.
Is there a solution for this? Is there a hot fix for that?
Thanks for your replyTry <cfreport> instead of <cfdocument> which give
better results for these type of pdf conversion and image
issues... -
PDF generation : FileNotFoundException problem
Hi all,
I'm developing a dynamic PDF generation module in web application using iText framework. This module creates PDF on the server side then sends it to the client. Sometimes, Even though the PDF file is created on the hard disk, I got FileNotFoundException when calling the servlet that sends it.
My program is very simple (no thread used) :
1- The client calls enters some inputs,
2 - The iText based class generates the PDF,
3 - The PDF created is saved as an attribute in the client session (HttpSession).
4 - The request is redirected to servlet that sends the PDF.
What could be the problem ?
thx,In fact, I don't know what you mean by:
3 - The PDF created is saved as an attribute in the client session (HttpSession).What do you mean by this? Did you save the proprietry PDF object? Or the java.io.File object? If it is the PDF object, does its class implement java.io.Serializable?
Um ... Here are some suggestions ...
First of all, make sure that the file really exists there.
Secondly, try to write a Java SE program to read the file using the absolute path you provided.
Then, if the Java SE program works, I think the reason may be that you haven't closed the "OutputStream" which writes the PDF file, or the security settings of your JSPServer prevents you from getting the file.
Asuka Kenji (UserID = 289)
(Duke Dollar Hunting now ...)
Maybe you are looking for
-
How Do I Add 2nd Monitor using AppleTV?
I use a mid - 2012 Mac Pro; run Mavericks MacOS X 10.9.5. 1. I would like to know how to connect my SONY TV as a second monitor wirelessly using AppleTV. 2. Once 2nd monitor is connected: 3. What do I do to use the cursor and keyboard on the 2nd mon
-
What is the exactly a purchase voucher? regards VS
-
This long-awaited tool. Quickly create new shapes. Way to go! I understand that for complex shapes of many different forms niepotarzalne live schmaty corners that are difficult to save as a graphic style. But for an object that has changed corners sy
-
How can I hide the Customize link at the top right corner of the portlet.
-
Hi, I have been programming for DBz since years and now i am interested to develop a application for my 6233 so for that i need complete information about development tools apps etc.... thanks