Generate report with chart
Hello,
I want to generate multiple graph on the same report.
Is it possible ?
thanks.
if I should not modify the query, how to generate the graph many times? If you are using the following query, you can pass the parameter to run for one customer or for all customers:
select name,location,sal,departement from table1 t1 and table2 t2 where Number1 = Number2 and sal < 20000 and Number1 = '100'; So modified query will look like this (see the part in bold):
select name,location,sal,department from table1 t1 and table2 t2 where Number1 = Number2 and sal < 20000 and *(:p_customer_no is null or Number1 = :p_customer_no)*
Hope this helps.
Similar Messages
-
How to generate report with dynamic variable number of columns?
How to generate report with dynamic variable number of columns?
I need to generate a report with varying column names (state names) as follows:
SELECT AK, AL, AR,... FROM States ;
I get these column names from the result of another query.
In order to clarify my question, Please consider following table:
CREATE TABLE TIME_PERIODS (
PERIOD VARCHAR2 (50) PRIMARY KEY
CREATE TABLE STATE_INCOME (
NAME VARCHAR2 (2),
PERIOD VARCHAR2 (50) REFERENCES TIME_PERIODS (PERIOD) ,
INCOME NUMBER (12, 2)
I like to generate a report as follows:
AK CA DE FL ...
PERIOD1 1222.23 2423.20 232.33 345.21
PERIOD2
PERIOD3
Total 433242.23 56744.34 8872.21 2324.23 ...
The TIME_PERIODS.Period and State.Name could change dynamically.
So I can't specify the state name in Select query like
SELECT AK, AL, AR,... FROM
What is the best way to generate this report?SQL> -- test tables and test data:
SQL> CREATE TABLE states
2 (state VARCHAR2 (2))
3 /
Table created.
SQL> INSERT INTO states
2 VALUES ('AK')
3 /
1 row created.
SQL> INSERT INTO states
2 VALUES ('AL')
3 /
1 row created.
SQL> INSERT INTO states
2 VALUES ('AR')
3 /
1 row created.
SQL> INSERT INTO states
2 VALUES ('CA')
3 /
1 row created.
SQL> INSERT INTO states
2 VALUES ('DE')
3 /
1 row created.
SQL> INSERT INTO states
2 VALUES ('FL')
3 /
1 row created.
SQL> CREATE TABLE TIME_PERIODS
2 (PERIOD VARCHAR2 (50) PRIMARY KEY)
3 /
Table created.
SQL> INSERT INTO time_periods
2 VALUES ('PERIOD1')
3 /
1 row created.
SQL> INSERT INTO time_periods
2 VALUES ('PERIOD2')
3 /
1 row created.
SQL> INSERT INTO time_periods
2 VALUES ('PERIOD3')
3 /
1 row created.
SQL> INSERT INTO time_periods
2 VALUES ('PERIOD4')
3 /
1 row created.
SQL> CREATE TABLE STATE_INCOME
2 (NAME VARCHAR2 (2),
3 PERIOD VARCHAR2 (50) REFERENCES TIME_PERIODS (PERIOD),
4 INCOME NUMBER (12, 2))
5 /
Table created.
SQL> INSERT INTO state_income
2 VALUES ('AK', 'PERIOD1', 1222.23)
3 /
1 row created.
SQL> INSERT INTO state_income
2 VALUES ('CA', 'PERIOD1', 2423.20)
3 /
1 row created.
SQL> INSERT INTO state_income
2 VALUES ('DE', 'PERIOD1', 232.33)
3 /
1 row created.
SQL> INSERT INTO state_income
2 VALUES ('FL', 'PERIOD1', 345.21)
3 /
1 row created.
SQL> -- the basic query:
SQL> SELECT SUBSTR (time_periods.period, 1, 10) period,
2 SUM (DECODE (name, 'AK', income)) "AK",
3 SUM (DECODE (name, 'CA', income)) "CA",
4 SUM (DECODE (name, 'DE', income)) "DE",
5 SUM (DECODE (name, 'FL', income)) "FL"
6 FROM state_income, time_periods
7 WHERE time_periods.period = state_income.period (+)
8 AND time_periods.period IN ('PERIOD1','PERIOD2','PERIOD3')
9 GROUP BY ROLLUP (time_periods.period)
10 /
PERIOD AK CA DE FL
PERIOD1 1222.23 2423.2 232.33 345.21
PERIOD2
PERIOD3
1222.23 2423.2 232.33 345.21
SQL> -- package that dynamically executes the query
SQL> -- given variable numbers and values
SQL> -- of states and periods:
SQL> CREATE OR REPLACE PACKAGE package_name
2 AS
3 TYPE cursor_type IS REF CURSOR;
4 PROCEDURE procedure_name
5 (p_periods IN VARCHAR2,
6 p_states IN VARCHAR2,
7 cursor_name IN OUT cursor_type);
8 END package_name;
9 /
Package created.
SQL> CREATE OR REPLACE PACKAGE BODY package_name
2 AS
3 PROCEDURE procedure_name
4 (p_periods IN VARCHAR2,
5 p_states IN VARCHAR2,
6 cursor_name IN OUT cursor_type)
7 IS
8 v_periods VARCHAR2 (1000);
9 v_sql VARCHAR2 (4000);
10 v_states VARCHAR2 (1000) := p_states;
11 BEGIN
12 v_periods := REPLACE (p_periods, ',', ''',''');
13 v_sql := 'SELECT SUBSTR(time_periods.period,1,10) period';
14 WHILE LENGTH (v_states) > 1
15 LOOP
16 v_sql := v_sql
17 || ',SUM(DECODE(name,'''
18 || SUBSTR (v_states,1,2) || ''',income)) "' || SUBSTR (v_states,1,2)
19 || '"';
20 v_states := LTRIM (SUBSTR (v_states, 3), ',');
21 END LOOP;
22 v_sql := v_sql
23 || 'FROM state_income, time_periods
24 WHERE time_periods.period = state_income.period (+)
25 AND time_periods.period IN (''' || v_periods || ''')
26 GROUP BY ROLLUP (time_periods.period)';
27 OPEN cursor_name FOR v_sql;
28 END procedure_name;
29 END package_name;
30 /
Package body created.
SQL> -- sample executions from SQL:
SQL> VARIABLE g_ref REFCURSOR
SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2,PERIOD3','AK,CA,DE,FL', :g_ref)
PL/SQL procedure successfully completed.
SQL> PRINT g_ref
PERIOD AK CA DE FL
PERIOD1 1222.23 2423.2 232.33 345.21
PERIOD2
PERIOD3
1222.23 2423.2 232.33 345.21
SQL> EXEC package_name.procedure_name ('PERIOD1,PERIOD2','AK,AL,AR', :g_ref)
PL/SQL procedure successfully completed.
SQL> PRINT g_ref
PERIOD AK AL AR
PERIOD1 1222.23
PERIOD2
1222.23
SQL> -- sample execution from PL/SQL block
SQL> -- using parameters derived from processing
SQL> -- cursors containing results of other queries:
SQL> DECLARE
2 CURSOR c_period
3 IS
4 SELECT period
5 FROM time_periods;
6 v_periods VARCHAR2 (1000);
7 v_delimiter VARCHAR2 (1) := NULL;
8 CURSOR c_states
9 IS
10 SELECT state
11 FROM states;
12 v_states VARCHAR2 (1000);
13 BEGIN
14 FOR r_period IN c_period
15 LOOP
16 v_periods := v_periods || v_delimiter || r_period.period;
17 v_delimiter := ',';
18 END LOOP;
19 v_delimiter := NULL;
20 FOR r_states IN c_states
21 LOOP
22 v_states := v_states || v_delimiter || r_states.state;
23 v_delimiter := ',';
24 END LOOP;
25 package_name.procedure_name (v_periods, v_states, :g_ref);
26 END;
27 /
PL/SQL procedure successfully completed.
SQL> PRINT g_ref
PERIOD AK AL AR CA DE FL
PERIOD1 1222.23 2423.2 232.33 345.21
PERIOD2
PERIOD3
PERIOD4
1222.23 2423.2 232.33 345.21 -
Deadlock with thread issues while generating reports with Crystal Report XI
We are facing deadlock with thread issues while generating report with Crystal Report XI
Version Number is 11.0 and the database used is Oracle
In the log file on line number 74350 by 2008/12/16 13:35:54 there is a dead lock with Thread: u20184u2019 is waiting to acquire lock for 'com.crystaldecisions.reports.queryengine.av@15214b9' which is held by the Thread: '0'.
And a dead lock with Thread: u20180u2019 is waiting to acquire lock for 'com.crystaldecisions.reports.queryengine.av@15214b9' which is held by the Thread: '4'.
Exactly after 10 minutes we can see the thread 4 and 0 are declared as STUCK by 2008/12/16 13:45:54 .
Is this an existing issue with Crystal Report?
Is there some solution for this problem?
THE LOG FILE INFORMATION IS GIVEN BELOW
[deadlocked thread] [ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)':
Thread '[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'' is waiting to acquire lock 'com.crystaldecisions.reports.queryengine.av@15214b9' that is held by thread '[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)''
Stack trace:
com.crystaldecisions.reports.queryengine.av.V(Unknown Source)
com.crystaldecisions.reports.queryengine.av.do(Unknown Source)
com.crystaldecisions.reports.queryengine.as.if(Unknown Source)
com.crystaldecisions.reports.reportdefinition.datainterface.j.c(Unknown Source)
com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
com.crystaldecisions.reports.reportdefinition.cy.b(Unknown Source)
com.crystaldecisions.reports.reportdefinition.cy.long(Unknown Source)
com.crystaldecisions.reports.reportdefinition.a1.o(Unknown Source)
com.crystaldecisions.reports.reportdefinition.a1.a(Unknown Source)
com.crystaldecisions.reports.common.ab.a(Unknown Source)
com.crystaldecisions.reports.common.ab.if(Unknown Source)
com.crystaldecisions.reports.reportdefinition.a1.if(Unknown Source)
com.crystaldecisions.reports.reportdefinition.a1.o(Unknown Source)
com.crystaldecisions.reports.reportengineinterface.a.a(Unknown Source)
com.crystaldecisions.reports.reportengineinterface.a.a.b.a(Unknown Source)
com.crystaldecisions.reports.sdk.ReportClientDocument.open(Unknown Source)
com.sysarris.aris.crystalreports.RepServlet.generateReport(RepServlet.java:65)
com.sysarris.aris.crystalreports.RepServlet.doPost(RepServlet.java:40)
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
[deadlocked thread] [ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)':
Thread '[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'' is waiting to acquire lock 'com.crystaldecisions.reports.queryengine.av@12e0415' that is held by thread '[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)''
Stack trace:
com.crystaldecisions.reports.queryengine.av.V(Unknown Source)
com.crystaldecisions.reports.queryengine.av.do(Unknown Source)
com.crystaldecisions.reports.queryengine.as.if(Unknown Source)
com.crystaldecisions.reports.reportdefinition.datainterface.j.c(Unknown Source)
com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
com.crystaldecisions.reports.reportdefinition.cy.b(Unknown Source)
com.crystaldecisions.reports.reportdefinition.cy.long(Unknown Source)
com.crystaldecisions.reports.reportdefinition.a1.o(Unknown Source)
com.crystaldecisions.reports.reportdefinition.a1.a(Unknown Source)
com.crystaldecisions.reports.common.ab.a(Unknown Source)
com.crystaldecisions.reports.common.ab.if(Unknown Source)
com.crystaldecisions.reports.reportdefinition.a1.if(Unknown Source)
com.crystaldecisions.reports.reportdefinition.a1.o(Unknown Source)
com.crystaldecisions.reports.reportengineinterface.a.a(Unknown Source)
com.crystaldecisions.reports.reportengineinterface.a.a.b.a(Unknown Source)
com.crystaldecisions.reports.sdk.ReportClientDocument.open(Unknown Source)
com.sysarris.aris.crystalreports.RepServlet.generateReport(RepServlet.java:65)
com.sysarris.aris.crystalreports.RepServlet.doPost(RepServlet.java:40)
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
Can you please suggest any work around for this?I'm not referring to Servlet threading issues.
I'll clarify.
You have two threads, both entering ReportClientDocument.open(...) method.
Thread 4 is waiting to acquire 'com.crystaldecisions.reports.queryengine.av@15214b9'
Thread 0 is waiting to acquire ''com.crystaldecisions.reports.queryengine.av@12e0415'
So I'm thinking ??? are they the same objects?
My specific question concerning the ReportClientDocument is that both are calling open - i.e., trying to open a new report. You wouldn't be trying to open different reports using the same ReportClientDocument - so was wondering if you've cached the RCD and trying to open two different reports at the same time on the same instance via different threads.
You'd normally tie a ReportClientDocument instance to a HTTP Session, to ensure each user gets their own copy.
Sincerely,
Ted Ueda -
Why do reports with charts run so slowly?
I have a report that has a chart for every group (about 15 groups). It takes ages to run. Is there anything you can do to make reports with charts run more quickly?
Cheers guys
AnnabelleI know this sounds like a joke, but give it a try, we had the same problem. It seems that reports is waiting for an event.
Move the mouse over the screen (I believe in particularly the reports progess dialog).
This should make it run a lot faster. -
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). -
Unable to run a report with chart
I have report rel.6 NT version installed on Windows 2000.Now I want to run my report with a chart.But after I finished the chart
wizard and try to run it,it gives me error.The error says that it is unable to create a PL/SQL Development Environment context.I also try it on Report Runtime
and it gives me error "REP-0074:Failure to run another product using SSL".Anybody out there can help me.Is it because of my operating system or ????Charlie:
I think we might be dealing with a bug: I have the same problem. I'm stumpted as well. Let me know if you make any headway. I think it might be best to call Oracle tech support.
Paul -
Generate Report with BI Publisher can't completed
Hi all,
I am new in oracle.
Can anyone help me to solve this problem when I want to generate report by using XML publisher.
I have made my template for my report in Microsoft Word and I am using BIPublisherDesktop to generate my report.
Actually I want to make a conditional formatting and I always prompted with this error :
Caused by: oracle.xdo.parser.v2.XSLException: <Line 100, Column 86>: XML-22047: (Error) Invalid instantiation of 'Attribute' in 'Element' context.
Can anyone help me to solve this problem. I have read on this forum and I got not solution with it. Thanks a lot.It all depends on your XML file structure. Can you help us with a sample XML file. You can also mail me [email protected]
Cheers,
ND
Use the "helpful" or "correct" buttons to award points to replies / Mark the thread as answered, if your question is answered. -
Error in Generating reports with large amount of data using OBIR
Hi all,
we hve integrated OBIR (Oracle BI Reporting) with OIM (Oracle Identity management) to generate the custom reports. Some of the custom reports contain a large amount of data (approx 80-90K rows with 7-8 columns) and the query of these reports basically use the audit tables and resource form tables primarily. Now when we try to generate the report, it is working fine with HTML where report directly generate on console but the same report when we tried to generate and save in pdf or Excel it gave up with the following error.
[120509_133712190][][STATEMENT] Generating page [1314]
[120509_133712193][][STATEMENT] Phase2 time used: 3ms
[120509_133712193][][STATEMENT] Total time used: 41269ms for processing XSL-FO
[120509_133712846][oracle.apps.xdo.common.font.FontFactory][STATEMENT] type1.Helvetica closed.
[120509_133712846][oracle.apps.xdo.common.font.FontFactory][STATEMENT] type1.Times-Roman closed.
[120509_133712848][][PROCEDURE] FO+Gen time used: 41924 msecs
[120509_133712848][oracle.apps.xdo.template.FOProcessor][STATEMENT] clearInputs(Object) is called.
[120509_133712850][oracle.apps.xdo.template.FOProcessor][STATEMENT] clearInputs(Object) done. All inputs are cleared.
[120509_133712850][oracle.apps.xdo.template.FOProcessor][STATEMENT] End Memory: max=496MB, total=496MB, free=121MB
[120509_133818606][][EXCEPTION] java.net.SocketException: Socket closed
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:99)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at weblogic.servlet.internal.ChunkOutput.writeChunkTransfer(ChunkOutput.java:525)
at weblogic.servlet.internal.ChunkOutput.writeChunks(ChunkOutput.java:504)
at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:382)
at weblogic.servlet.internal.ChunkOutput.checkForFlush(ChunkOutput.java:469)
at weblogic.servlet.internal.ChunkOutput.write(ChunkOutput.java:304)
at weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:139)
at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:169)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:105)
at oracle.apps.xdo.servlet.util.IOUtil.readWrite(IOUtil.java:47)
at oracle.apps.xdo.servlet.CoreProcessor.process(CoreProcessor.java:280)
at oracle.apps.xdo.servlet.CoreProcessor.generateDocument(CoreProcessor.java:82)
at oracle.apps.xdo.servlet.ReportImpl.renderBodyHTTP(ReportImpl.java:562)
at oracle.apps.xdo.servlet.ReportImpl.renderReportBodyHTTP(ReportImpl.java:265)
at oracle.apps.xdo.servlet.XDOServlet.writeReport(XDOServlet.java:270)
at oracle.apps.xdo.servlet.XDOServlet.writeReport(XDOServlet.java:250)
at oracle.apps.xdo.servlet.XDOServlet.doGet(XDOServlet.java:178)
at oracle.apps.xdo.servlet.XDOServlet.doPost(XDOServlet.java:201)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at oracle.apps.xdo.servlet.security.SecurityFilter.doFilter(SecurityFilter.java:97)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
It seems where the querry processing is taking some time we are facing this issue.Do i need to perform any additional configuration to generate such reports?java.net.SocketException: Socket closed
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:99)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at weblogic.servlet.internal.ChunkOutput.writeChunkTransfer(ChunkOutput.java:525)
at weblogic.servlet.internal.ChunkOutput.writeChunks(ChunkOutput.java:504)
at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:382)
at weblogic.servlet.internal.CharsetChunkOutput.flush(CharsetChunkOutput.java:249)
at weblogic.servlet.internal.ChunkOutput.checkForFlush(ChunkOutput.java:469)
at weblogic.servlet.internal.CharsetChunkOutput.implWrite(CharsetChunkOutput.java:396)
at weblogic.servlet.internal.CharsetChunkOutput.write(CharsetChunkOutput.java:198)
at weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:139)
at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:169)
at com.tej.systemi.util.AroundData.copyStream(AroundData.java:311)
at com.tej.systemi.client.servlet.servant.Newdownloadsingle.producePageData(Newdownloadsingle.java:108)
at com.tej.systemi.client.servlet.servant.BaseViewController.serve(BaseViewController.java:542)
at com.tej.systemi.client.servlet.FrontController.doRequest(FrontController.java:226)
at com.tej.systemi.client.servlet.FrontController.doPost(FrontController.java:128)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:17
(Please help finding a solution in this issue its in production and we need to ASAP)
Thanks in Advance
Edited by: 909601 on Jan 23, 2012 2:05 AM -
Report with chart in 11g fails
Iam building an RTF template in Word with chart and some data. The chart is inside a group. Everything works fine from BIP desktop. When i upload the template into 11g and run the report, I get 'File does not begin with '%PDF-%' error. When i remove the chart, the report works fine in 11g. Has any one faced a similar issue? Can someone help me with this error.
Thanks in advance.Check to see if the solution offered in the following post might help you (look for "Fixing an error received on PDF generation" section):
http://www.oracleappsblog.com/index.php/weblog/printing-reports-pdf-format-oracle-applications/
Thanks,
Bipuser -
Oracle Reports - Unable to generate report with colored image in bitmap mod
Hi,
I am using Oracle reports 6i.
I am generating a post script[.ps] file using bitmap mode.
The layout contains an image. The image is stored in oracle database which is colored image.
But when the report is generated same is being generated with gray color.
Could any one advise on resolving this issue? The objective is to generate the report with colored image and not gray or black&whiteWhat kind of images do you have? Reports only supports a few formats, e.g. JFIF. So, if you have JPG images with EXIF meta information in the header, you have to remove those first.
when the report is generated same is being generated with gray color.What happens if you sent the output directly to the printer?
And what happens if you create a PDF file instead of Postscript? -
Generate report with data from database package
Hi
Is it possible to generate a report where the values come from an oracle database package instead of from an sql query declared in the report itself?
If yes, how is it done?
Appreciate any help. Thx.Hi,
You can use REF CURSORs to generate reports from a database package.
For information about REF CURSORs, please see Chapter 40 'Building a Paper Report with REF CURSORs' of the Oracle Reports Building Reports manual.
This chapter is at:
http://download-uk.oracle.com/docs/html/B13895_01/orbr_refcur.htm#i1011693
Hope this helps.
Regards,
Panna -
How to email a report with embedded images of metric charts?
My mailed reports are showing a text message like "Chart titled" instead of an image in the place of a chart !I know this sounds like a joke, but give it a try, we had the same problem. It seems that reports is waiting for an event.
Move the mouse over the screen (I believe in particularly the reports progess dialog).
This should make it run a lot faster. -
Generating Report with vertical lines from Designer
Hi:
I would like to get any suggestions about generating tabular reports with vertical lines from Oracle Designer 6.0 on Windows NT.
Any help will be appreciated.
Thanks in advanceHey c2petrov,
Thanks for using Apple Support Communities.
After reviewing your post, it sounds like you are having trouble with the screen. A frustrating situation to be sure. This article addresses issues with video on internal or external displays.
Apple computers: Troubleshooting issues with video on internal or external displays
http://support.apple.com/kb/HT1573
Have a nice day,
Mario -
How do I access(read) dynamically generated reports with WebLogic WebServer
Hello Everyone,
In our application we are generating reports (pdf format) at run time. How do
we read these files.....which directory should we store these files to... I am
using Weblogic 6.0.
These files have timestamp as part of their name so the names are not static.
Thanks in advance.
AhsenWe ran into this also. If you read the J2EE specs carefully you will see
that your app is only guaranteed to have write-access to a single directory,
defined by the context attribute "javax.servlet.context.tempdir" -- I can
find the exact reference if you want.
Here is how to get this attribute:
File tempdir = (File) getServletContext()
.getAttribute("javax.servlet.context.tempdir");
log.debug("context temp dir = " + tempdir.getAbsolutePath());
Although this may seem horribly restrictive, it makes a lot of sense on a
secure system where applications are deployed by a specific user, and may
have at runtime minimal filesytem priviledges -- your app can't write
anywhere, at the exception of the context temp dir. I know this would be the
way I'd setup my container on a Unix system for example.
So, what's a developer to do? You can either bypass the issue and always
generate your content dynamically, with a servlet setting the appropriate
MIME type to the output, or write your reports to the context temp dir and
manually serve content from there.
Frankly I think the first option is by far the most simple, easier to
implement, and thus attractive; if it leads to a performance problem, you
can always solve that with a Web cache. Doing otherwise (caching the content
yourself) opens the door to many issues, that really shouldn't be your
problem as a Web application developer. Keep it simple!
--Renaud
"ahsen" <[email protected]> wrote in message
news:173_3bc31ee1$[email protected]..
>
Hello Everyone,
In our application we are generating reports (pdf format) at run time.How do
we read these files.....which directory should we store these files to...I am
using Weblogic 6.0.
These files have timestamp as part of their name so the names are notstatic.
>
Thanks in advance.
Ahsen -
Generate Report with fixedsys font
Hi, I created a report with fixedsys font , it works fine with oracle 6i but when converted to application server 10g the font change to Ariel and I can not make it appeare as fixedsys.
As long as the font is on your system and it is licensed for embedding, you need to embed the font in the PDF. That is set within the job.options. Typically the print and press job options will embed all fonts. Standard will embed most. Smallest-file-size embeds no fonts as I recall.
Maybe you are looking for
-
Errors x86 and x64 reinstalling MS Office 2010. Same problem with Trial MS Office 2013
Hi. I lost MS Office 2010 3 weeks ago, after I tried to rename my Owner username in the registry, following steps I found online. I have not been able to restore MS Office at all. I received Office I have attempted to uninstall and reinstall severa
-
Weird problems with my Lenovo G510 Notebook
Good morning. At the very beginning I would like to inform you that I don't know whether it's a good place to ask for solving my problems thus if I simply misundertood something, delete this post promptly. A few times my computer has stopped working
-
Multiple scales do not assign properly ot traces
The Labview XY Graph object does not allow me to map signals properly to their scales. I have attached a simple XY Graph VI where there are 3 input traces that I want to map to their 3 respective Y Scales. The drop down menu item does not allow me
-
Containter -- Container binding
Can someone explain me in detail the difference between the three container bindings? - Copy All Elements (Except System) - Programmed Binding (BOR Container) - Programmed Binding (Container IF) Where can I find some example function modules or class
-
NEW ITOUCH USER... HOW DO I TRANSFER CD TO MY ITOUCH
new itouch user... how do i transfer a music CD to my itouch??