Generating an html report based on table at sql 2005 db
Hi
I want to create an html report based on a table named inventory on sql server 2005 database.
first code used to generate an output report
try {
// TODO add your handling code here:
String s = "<html> <body> <table border=1><caption> Inventory Report </caption>";
s += "<tr><td>Item_id<td>item_name<td>Existing quantity</td><tr><td>3<td>4<td> <td>";
byte[] sb = s.getBytes();
FileOutputStream fs = null;
try {
fs = new FileOutputStream("D:\\Report\\Report.html");
} catch (FileNotFoundException ex) {
Logger.getLogger(mileshframe.class.getName()).log(Level.SEVERE, null, ex);
fs.write(sb);
fs.close();
} catch (IOException ex) {
Logger.getLogger(mileshframe.class.getName()).log(Level.SEVERE, null, ex);
Second jdbc code for connection and select all records in the table
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:MerchandiseCon","sa","sql123#");
st = con.createStatement( );
ResultSet rset=st.executeQuery("Select Item_code,Item_Name,item_cost,item_quantity from Inventory");
String s="";
while(rset.next())
s+=(rset.getString(1)+"\t\t"+rset.getString(2)+"\t"+rset.getString(3)+"\t"+rset.getString(4)+"\n");
st.close();
con.close();
catch(ClassNotFoundException ex)
ex.printStackTrace();
catch(SQLException ex)
ex.printStackTrace();
} I want someone helps me to merge two codes into one code to generate an output html report.
thanks in advance
This is my trial but not the desired result ,it's displayed the title and a line only
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
String s = "<html> <body> <table border=1> <caption>Report title</caption>";
byte[] sb = s.getBytes();
FileOutputStream fs = null;
try {
// TODO add your handling code here:
try {
fs = new FileOutputStream("D:\\Report\\myeport.html");
} catch (FileNotFoundException ex) {
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
fs.write(sb);
fs.close();
} catch (IOException ex) {
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:MerchandiseCon","sa","sql123#");
st = con.createStatement( );
ResultSet rset=st.executeQuery("Select Item_code,Item_Name,item_cost,item_quantity from Inventory");
while(rset.next())
s+=("<tr><td>"+rset.getString("Item_Code")+"</td><td>"+rset.getString("Item_Name")+"</td><td>"+rset.getString("item_cost")+"</td><td>"+rset.getString("item_quantity")+"</td></tr>");
try {
// TODO add your handling code here:
try {
fs = new FileOutputStream("D:\\Report\\myeport.html");
} catch (FileNotFoundException ex) {
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
fs.write(sb);
fs.close();
} catch (IOException ex) {
Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
st.close();
con.close();
catch(ClassNotFoundException ex)
ex.printStackTrace();
catch(SQLException ex)
ex.printStackTrace();
}
Similar Messages
-
Hi,
I ame trying to generate an html report with SQL/Plus, I have read some tutorial but I have not understood well how I can approach the issue.
Actually I have this report:
SET TRIMSPOOL on
SET PAGES 0
SET NEWPAGE 0
SET VERIFY OFF
SET FEEDBACK OFF
SET SPACE 0
SET ECHO OFF
SET MARKUP HTML Off
SELECT 'CENSIMENTO VARIAZIONE PRODOTTI'
FROM DUAL;
SELECT ''
FROM DUAL;
SELECT ''
FROM DUAL;
SELECT 'Evoluzione VAR'
FROM DUAL;
SELECT '--------------'
FROM DUAL;
SELECT ''
FROM DUAL;
SELECT RPAD('ISIN', 21, ' ')||' '||
RPAD('SGN', 4, ' ')||' '||
RPAD('VAR', 4, ' ')||' '||
RPAD('REF_DATE', 10, ' ')||' '||
RPAD('START_DATE', 10, ' ')
FROM DUAL;
SELECT RPAD('=', 10, '=')||' '||
RPAD('=', 3, '=')||' '||
RPAD('=', 3, '=')||' '||
RPAD('=', 8, '=')||' '||
RPAD('=', 9, '=')
FROM DUAL;
SELECT LPAD(TAB1.COD_ISIN, 12, ' ')||' '||
LPAD(TAB1.VAR_TRIMESTRALE_SGN, 3, ' ')||' '||
LPAD(TRIM(TAB1.VAR_TRIMESTRALE), 3, ' ')||' '||
LPAD(to_char(TAB1.DATA_TIMESTAMP, 'DD/MM/YYYY'), 11, ' ')||' '||
LPAD(to_char(TAB1.START_DATE, 'DD/MM/YYYY'), 11, ' ')
FROM SPR_ISIN_DSI_TO TAB1
INNER JOIN SPR_STATUS TAB2
ON TAB1.COD_ISIN = TAB2.ISIN
WHERE --TRUNC(TAB1.START_DATE) = TRUNC(SYSDATE)
--OR TRUNC(TAB1.END_DATE) = TRUNC(SYSDATE)
--AND
TAB2.DSITO_VAR = 'Y'
ORDER BY TAB1.COD_ISIN, TAB1.START_DATE DESC;
SELECT ''
FROM DUAL;
SELECT 'COLLEZIONE STATISTICHE: '
FROM DUAL;
--SELECT '================='
--FROM DUAL;
SELECT ' -Prodotti finanziari finanziari censiti: '||COUNT(COD_ISIN)
FROM SPR_ISIN_DSI_TO
WHERE END_DATE IS NULL;
SELECT ' -Prodotti finanziari aggiornati: '||COUNT(DISTINCT TAB1.COD_ISIN)
FROM SPR_ISIN_DSI_TO TAB1
INNER JOIN SPR_STATUS TAB2
ON TAB1.COD_ISIN = TAB2.ISIN
WHERE TAB2.DSITO_VAR = 'Y'
AND TAB2.NEW = 'N'
AND TAB1.END_DATE IS NULL;
SELECT ' -Nuovi prodotti finanziari censiti: '||COUNT(DISTINCT TAB1.COD_ISIN)
FROM SPR_ISIN_DSI_TO TAB1
INNER JOIN SPR_STATUS TAB2
ON TAB1.COD_ISIN = TAB2.ISIN
WHERE TAB2.DSITO_VAR = 'Y'
AND TAB2.NEW = 'Y'
AND TAB1.END_DATE IS NULL;
SELECT ' -Prototti. finanziari rimossi: '||COUNT(DISTINCT TAB1.COD_ISIN)
FROM SPR_ISIN_DSI_TO TAB1
WHERE TRUNC(TAB1.END_DATE) = TRUNC(SYSDATE)
AND NOT EXISTS (
SELECT COD_ISIN
FROM SPR_ISIN_DSI_TO TAB2
WHERE TAB2.END_DATE IS NOT NULL
AND TAB1.COD_ISIN = TAB2.COD_ISIN
);I would translate this in HTML.
I have begun to write this code:
set markup html on
head ' -
table {background: #eee; fone-size: 80% } -
th { background: #ccc: } -
td { padding: 0px; } -
spool result.html
PROMPT <H1>Censimento variazione prodotti</H1>
PROMPT <H2>Evoluzione var</H2>
set termout off
set pagesize 80
column TAB1.COD_ISIN 'Isin'
column TAB1.VAR_TRIMESTRALE_SGN 'Segno var trimestrale'
column TAB1.VAR_TRIMESTRALE 'Var trimestrale'
column TAB1.DATA_TIMESTAMP 'Data timestamp'
column TAB1.START_DATE 'Start date'
SELECT LPAD(TAB1.COD_ISIN, 12, ' ')||' '||
LPAD(TAB1.VAR_TRIMESTRALE_SGN, 3, ' ')||' '||
LPAD(TRIM(TAB1.VAR_TRIMESTRALE), 3, ' ')||' '||
LPAD(to_char(TAB1.DATA_TIMESTAMP, 'DD/MM/YYYY'), 11, ' ')||' '||
LPAD(to_char(TAB1.START_DATE, 'DD/MM/YYYY'), 11, ' ')
FROM SPR_ISIN_DSI_TO TAB1
INNER JOIN SPR_STATUS TAB2
ON TAB1.COD_ISIN = TAB2.ISIN
WHERE --TRUNC(TAB1.START_DATE) = TRUNC(SYSDATE)
--OR TRUNC(TAB1.END_DATE) = TRUNC(SYSDATE)
--AND
TAB2.DSITO_VAR = 'Y'
ORDER BY TAB1.COD_ISIN, TAB1.START_DATE DESC;
spool off
set markup html offBut when I try to execute this code I receive this error:
ORA-00900: invalid SQL statementBut, moreover I have another problem how can I insert in the html version this part of the old report:
SELECT 'COLLEZIONE STATISTICHE: '
FROM DUAL;
--SELECT '================='
--FROM DUAL;
SELECT ' -Prodotti finanziari finanziari censiti: '||COUNT(COD_ISIN)
FROM SPR_ISIN_DSI_TO
WHERE END_DATE IS NULL;
SELECT ' -Prodotti finanziari aggiornati: '||COUNT(DISTINCT TAB1.COD_ISIN)
FROM SPR_ISIN_DSI_TO TAB1
INNER JOIN SPR_STATUS TAB2
ON TAB1.COD_ISIN = TAB2.ISIN
WHERE TAB2.DSITO_VAR = 'Y'
AND TAB2.NEW = 'N'
AND TAB1.END_DATE IS NULL;
SELECT ' -Nuovi prodotti finanziari censiti: '||COUNT(DISTINCT TAB1.COD_ISIN)
FROM SPR_ISIN_DSI_TO TAB1
INNER JOIN SPR_STATUS TAB2
ON TAB1.COD_ISIN = TAB2.ISIN
WHERE TAB2.DSITO_VAR = 'Y'
AND TAB2.NEW = 'Y'
AND TAB1.END_DATE IS NULL;
SELECT ' -Prototti. finanziari rimossi: '||COUNT(DISTINCT TAB1.COD_ISIN)
FROM SPR_ISIN_DSI_TO TAB1
WHERE TRUNC(TAB1.END_DATE) = TRUNC(SYSDATE)
AND NOT EXISTS (
SELECT COD_ISIN
FROM SPR_ISIN_DSI_TO TAB2
WHERE TAB2.END_DATE IS NOT NULL
AND TAB1.COD_ISIN = TAB2.COD_ISIN
);I have found some tutorial but I do not succed to understand what I have to do.
I try to execute the previuos code in toad, for simplicity how can I obtain the html output in my window?
Thanks a lot, bye bye.Hi Abdujaparov,
To prevent your ORA-00900: invalid SQL statement, try putting the head option on the same line as set:
set markup html on head ' -
To execute in TOAD, execute as script by pressing F5 (Never tried with markup, though)
Regards
Peter -
Using javascript to dynamically generate the html for a Spry table
I have some javascript which generates html code for a Spry
table which displays the content of a Spry data set. The problem is
that after I generate the html, Spry never fills in the values for
the table.
Here's what I'm doing:
Using a data set observer, check for onPostLoad and generate
the html code
Using innerHTML, stuff the code into the appropriate
<div>
Use regionName.updateContent() to update the region I just
created with the html code I generated
Interestingly, if I take the generated source for my page and
remove the data set observer, the Spry table displays correctly
with all the expected values. This suggests to me that my generated
html code is correct, but that there is some sort of timing issue
(i.e. Spry doesn't know about the new code I generated).
Any suggestions?jalperin wrote:
> Here's what I'm doing:
>
Using a data set observer, check for
onPostLoad and generate the html
> code
>
Using innerHTML, stuff the code into
the appropriate <div>
>
Use regionName.updateContent() to
update the region I just created
> with the html code I generated
>
> Interestingly, if I take the generated source for my
page and remove the data
> set observer, the Spry table displays correctly with all
the expected values.
> This suggests to me that my generated html code is
correct, but that there is
> some sort of timing issue (i.e. Spry doesn't know about
the new code I
> generated).
>
> Any suggestions?
I'd guess that it is a timing issue as well. I haven't looked
much at the dataset capability in Spry, but it may be that the
dataset "finds" all of the regions and code that it applies to
before the onPostLoad event is triggered. If that is the case, then
your generated code doesn't exist yet,and so the dataset thinks
that there is nothing for it to apply to.
Will the HTML that you generate change based upon the dataset
that is actually returned? I guess I'm looking for the reason why
the HTML is being generated when it could be in the page itself and
avoid this issue completely.
Danilo Celic
|
http://blog.extensioneering.com/
| WebAssist Extensioneer
| Adobe Community Expert -
Generate static HTML Report from Abap
Hello dear BW-gurus,
Let me explain our problem: we need a html report which contains the query-result (like the normal result table in a web-query) and all corresponding (BW)documents to that query or key figures. Also all key figures formulas should be in that document.
Up to now no problem: I use an own class which inherits from cl_rsr_xls_grid, take the p_string (the query result as html formatted string) and concatenate all the other Information like documents or formulas html-formatted to that string. From this string I can generate a file or can countinue processing.
But here is my problem: We need a link from the key figures in the result table to the documents or formulas of the key figures.
please take a look to the example document:
<b>Query result</b>
0Datefrom | KPI A | KPI B
01.01.06 | 1234 | 2345
02.01.06 | 3456 | 4567
<b>existing Documents</b>
Doc A
KPI = KPI A , Datefrom = 02.01.06 : "Content of Document A"
Doc B
KPI = KPI B , Datefrom = 01.01.06 : "Content of Document B"
--> In this example, there should be two <a hrefs>-links:
1. From 3456 to Doc A
2. From 2345 to Doc B
Anyone has an idea of how to get it working? Is the class cl_rsr_xls_grid completely wrong for that? Do I have to use a cl_rsr_www* class and cl_rsr_www_modify_table? And if so, how can I generate a sting or so with the cl_rsr_www* classes?
thanks in forward for your help!
O.Tl.Hello dear BW-gurus,
Let me explain our problem: we need a html report which contains the query-result (like the normal result table in a web-query) and all corresponding (BW)documents to that query or key figures. Also all key figures formulas should be in that document.
Up to now no problem: I use an own class which inherits from cl_rsr_xls_grid, take the p_string (the query result as html formatted string) and concatenate all the other Information like documents or formulas html-formatted to that string. From this string I can generate a file or can countinue processing.
But here is my problem: We need a link from the key figures in the result table to the documents or formulas of the key figures.
please take a look to the example document:
<b>Query result</b>
0Datefrom | KPI A | KPI B
01.01.06 | 1234 | 2345
02.01.06 | 3456 | 4567
<b>existing Documents</b>
Doc A
KPI = KPI A , Datefrom = 02.01.06 : "Content of Document A"
Doc B
KPI = KPI B , Datefrom = 01.01.06 : "Content of Document B"
--> In this example, there should be two <a hrefs>-links:
1. From 3456 to Doc A
2. From 2345 to Doc B
Anyone has an idea of how to get it working? Is the class cl_rsr_xls_grid completely wrong for that? Do I have to use a cl_rsr_www* class and cl_rsr_www_modify_table? And if so, how can I generate a sting or so with the cl_rsr_www* classes?
thanks in forward for your help!
O.Tl. -
Reports based on SQL view contain no data. Reports based on tables work just fine
When we load a report into Crystal reports server that is based on a SQL view the report will run but will contain no data. A report that pulls data from SQL tables works just fine. Running the crystal report on standalone crystal reports works just fine.
I am completely lost on this one. If you have any ideas please send them my way.Are you missing an ODBC / TNS entry on your CMS (or report processing, if clustered env) server? This could definately be an issue if the report will run locally within CR client, but not when hosted on the enterprise environment. Another test would be to run the report from CR client ON the CRS / BOE server..
-
Generating an HTML report from two tabs.
Hi Guys, and sorry if the title is not clear.
My situation is like this: I have two tabs for two different conditions. In the first tab, I want generate part of my HTML report regarding the first tab. Then, in the second tab, I want add more details to my previous HTML report. Can this be done in LabVIEW 8.0? I appreciate any advice.
cheers and thanks!
MikeHello Gurdas,
I have not previously encountered this behavior when using the report generation toolkit to append images to a Word report. Can I assume that you are using the "Append Control Image to Report VI" to add these images to the Word report? With this VI you wire in a reference to each of the controls for which you are trying to export the image. I ask because I was able to successfully export images for graphs that I had not yet viewed on a tab control. Also, which version of LabVIEW are you using that you experience this difficulty?
One thing to consider may be execution order; when does data get written to graphs on each tab? Are you sure that an image append operation can never take place before data exists on a graph? If you have a small example VI that shows this behavior, that might help me to identify an easier workaround for you. I hope this information is useful for you. Thanks,
Mike D.
National Instruments
Applications Engineer
Message Edited by Duffman Says: on 02-13-2007 07:34 PM -
Dump while acessing tables in sql 2005 using DB connect
we have a sql 2000 as source system in place and now i created sql 2005 source system with DB connect.
bw version 3.0.
tables naming conventions are according to SAP.
when i click the button to show tables in source system (sql server) , it is throwing a short dump while connecting to data base.
I initially thought tahat something wrong with BW support pack , but my other sql connection is working perfectly fine.
plz help.
error in short dump
Error analysis
<b>Only message types A, E, I, W, S and X are allowed.
There is probably an error in the program
"RSDL_META_UPLOAD ". </b>
<b>MESSAGE_TYPE_UNKNOWN" C
RSDL_META_UPLOAD " or "RSDL_META_UPLOAD "
END-OF-SELECTION</b>"
> points will be awarded for useful inputs..
Message was edited by:
aravind sam
Message was edited by:
aravind samI am having the similar issue. I have DB connect to oracle schema, however, some of the tables I can view and access the data but others are throwing short dumps and following error:
Event with errors RSDL_META_UPLOAD in DataSource
I have applied support Pack 10 for BI. But this problem persist.
Any IDEA.
Thanks in Advance.
Shaukat -
Report error after update to SQL 2005
We revently updated our database server from SQL 2000 to SQL 2005. After the update we have a report getting the following error.
Failed to retrieve data from the database.
Details: 22018:[Microsoft][ODBC SQL Server Driver][SQL Server]Conversion failed when converting the varchar value '96.48' to data type int. [Database Vendor Code: 245]
The report contains 2 views with one join and worked fine previously. The field referenced by the error will display fine as long as there are no fields from the other view on the report. As soon as I add a field from the second view, no data is displayed. I have not created any conversion to integer within the Crystal report for any field. Any help getting this to work again would be greatly appreciated.Hi,
What steps did you perform before upgrading? dont update. Try to back-up all your database and restore to SQL Server 2005 manually lets see if it have problems, seems to me a conflict datatypes.
Regards,
Clint -
How to generate a Yearly report based on a calculation at the Month level
Have the need to create a report as follows. Any ideas on how this can be accomplished in OBI is appreciated. I have already tried different ways but non worked for me.
The data is stored in a table at day level as follows:
Day Amount_A Amouont_B
1/1/2008 100 100
1/15/2008 200 100
2/1/2008 100 400
2/15/2008 300 200
1/1/2009 100 300
1/15/2009 100 200
2/1/2009 200 100
2/15/2009 400 300
The report should be displayed at Year level. Amount_A is just the summation of Amount_A from the table at daily level rolled up to the Year level in the Time dimension. The same thing for Amount_B.
The formula for Absolute_Error is Absolute(Amount_A - Amount_B). But the problem is that it has to be calculated at the Month level instead of Day Level. So following is the logic for Absolute_Error:
Month Amount_A Amount_B Absolute_Error
Jan-2008 300 200 100
Feb-2008 400 600 200
Jan-2009 200 500 300
Feb-2009 600 400 200
The report should be displayed as follows:
Year Amount_A Amount_B Absolute_Error
2008 700 800 300
2009 800 900 500
Note that the calculation of Absolute_Error results in a different value if it is calculated at the Month level and summed up to Year than if it were calculated at the Day level and then summed up to Year. It is required to be based on Month level for this report.
Is there a way to do this without having to build an aggregated fact table at the Month level?Hi.
Do this:
1. Create Amount_A and Amount_B in BMM without SUM as default aggregation rule.
2. Now, just go to Answers and make report with three columns:
YEAR -- EXPRESSION 1 -- EXPRESSION 2
EXPRESSION 1 is:
sum(Amount_A) - sum(Amount_B)
EXPRESSION 2 is:
sum
abs
sum(Amount_A by MONTH)
sum(Amount_B by MONTH)
My example in Answers:
TIMES.CALENDAR_YEAR
sum(SALES.QUANTITY_SOLD_NORMAL) - sum(SALES.AMOUNT_SOLD_NORMAL)
sum( abs(sum(SALES.QUANTITY_SOLD_NORMAL by TIMES.CALENDAR_MONTH_DESC) - sum(SALES.AMOUNT_SOLD_NORMAL by TIMES.CALENDAR_MONTH_DESC) ) )
This will first summarize amount A and amount B on a month level and then do a difference, after that ABS and then sum on the year level.
This is workaround to avoid larger RPD changes.
Regards,
Goran O
http://108obiee.blogspot.com/ -
How to generate a customized report with a table
I have a table with two columns: month, count. The values are like the following:
Jan-2007 50
Feb-2007 46
Mar-2007 55
Apr-2007 76
Jan-2009 67
Feb-2009 86
Mar-2009 55
I want to generate a report like this:
Month 2007 2008 2009
January 50 76 67
Febuary 46 45 86
How to do that?
Thanks.
JenJen,
This is the best way I could come up with. It is a little clunky but it gets the job done. Basically it buckets each group by month and then unions each month together. I used the column names and formats you specified so you should only have to change the table name.
EDIT
You may want to do a nvl on each decode that way the sums will work correctly for nulls. Also, you could generate this sql statement procedurally and save yourself some maintenance time. This was just to show you how it could be approached.
SELECT 'January' "Month",
SUM(DECODE(substr(month,5,4),2000,count)) "2000",
SUM(DECODE(substr(month,5,4),2001,count))"2001",
SUM(DECODE(substr(month,5,4),2002,count))"2002",
SUM(DECODE(substr(month,5,4),2003,count))"2003",
SUM(DECODE(substr(month,5,4),2004,count))"2004",
SUM(DECODE(substr(month,5,4),2005,count))"2005",
SUM(DECODE(substr(month,5,4),2006,count))"2006",
SUM(DECODE(substr(month,5,4),2007,count))"2007",
SUM(DECODE(substr(month,5,4),2008,count))"2008",
SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
WHERE substr(month,1,3) = 'JAN'
GROUP BY 'January'
UNION ALL
SELECT 'February' "Month",
SUM(DECODE(substr(month,5,4),2000,count)) "2000",
SUM(DECODE(substr(month,5,4),2001,count))"2001",
SUM(DECODE(substr(month,5,4),2002,count))"2002",
SUM(DECODE(substr(month,5,4),2003,count))"2003",
SUM(DECODE(substr(month,5,4),2004,count))"2004",
SUM(DECODE(substr(month,5,4),2005,count))"2005",
SUM(DECODE(substr(month,5,4),2006,count))"2006",
SUM(DECODE(substr(month,5,4),2007,count))"2007",
SUM(DECODE(substr(month,5,4),2008,count))"2008",
SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
WHERE UPPER(substr(month,1,3)) = 'FEB'
GROUP BY 'February'
UNION ALL
SELECT 'March' "Month",
SUM(DECODE(substr(month,5,4),2000,count)) "2000",
SUM(DECODE(substr(month,5,4),2001,count))"2001",
SUM(DECODE(substr(month,5,4),2002,count))"2002",
SUM(DECODE(substr(month,5,4),2003,count))"2003",
SUM(DECODE(substr(month,5,4),2004,count))"2004",
SUM(DECODE(substr(month,5,4),2005,count))"2005",
SUM(DECODE(substr(month,5,4),2006,count))"2006",
SUM(DECODE(substr(month,5,4),2007,count))"2007",
SUM(DECODE(substr(month,5,4),2008,count))"2008",
SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
WHERE substr(month,1,3) = 'MAR'
GROUP BY 'March'
UNION ALL
SELECT 'April' "Month",
SUM(DECODE(substr(month,5,4),2000,count)) "2000",
SUM(DECODE(substr(month,5,4),2001,count))"2001",
SUM(DECODE(substr(month,5,4),2002,count))"2002",
SUM(DECODE(substr(month,5,4),2003,count))"2003",
SUM(DECODE(substr(month,5,4),2004,count))"2004",
SUM(DECODE(substr(month,5,4),2005,count))"2005",
SUM(DECODE(substr(month,5,4),2006,count))"2006",
SUM(DECODE(substr(month,5,4),2007,count))"2007",
SUM(DECODE(substr(month,5,4),2008,count))"2008",
SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
WHERE UPPER(substr(month,1,3)) = 'APR'
GROUP BY 'April'
UNION ALL
SELECT 'May' "Month",
SUM(DECODE(substr(month,5,4),2000,count)) "2000",
SUM(DECODE(substr(month,5,4),2001,count))"2001",
SUM(DECODE(substr(month,5,4),2002,count))"2002",
SUM(DECODE(substr(month,5,4),2003,count))"2003",
SUM(DECODE(substr(month,5,4),2004,count))"2004",
SUM(DECODE(substr(month,5,4),2005,count))"2005",
SUM(DECODE(substr(month,5,4),2006,count))"2006",
SUM(DECODE(substr(month,5,4),2007,count))"2007",
SUM(DECODE(substr(month,5,4),2008,count))"2008",
SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
WHERE substr(month,1,3) = 'MAY'
GROUP BY 'May'
UNION ALL
SELECT 'June' "Month",
SUM(DECODE(substr(month,5,4),2000,count)) "2000",
SUM(DECODE(substr(month,5,4),2001,count))"2001",
SUM(DECODE(substr(month,5,4),2002,count))"2002",
SUM(DECODE(substr(month,5,4),2003,count))"2003",
SUM(DECODE(substr(month,5,4),2004,count))"2004",
SUM(DECODE(substr(month,5,4),2005,count))"2005",
SUM(DECODE(substr(month,5,4),2006,count))"2006",
SUM(DECODE(substr(month,5,4),2007,count))"2007",
SUM(DECODE(substr(month,5,4),2008,count))"2008",
SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
WHERE UPPER(substr(month,1,3)) = 'JUN'
GROUP BY 'June'
UNION ALL
SELECT 'July' "Month",
SUM(DECODE(substr(month,5,4),2000,count)) "2000",
SUM(DECODE(substr(month,5,4),2001,count))"2001",
SUM(DECODE(substr(month,5,4),2002,count))"2002",
SUM(DECODE(substr(month,5,4),2003,count))"2003",
SUM(DECODE(substr(month,5,4),2004,count))"2004",
SUM(DECODE(substr(month,5,4),2005,count))"2005",
SUM(DECODE(substr(month,5,4),2006,count))"2006",
SUM(DECODE(substr(month,5,4),2007,count))"2007",
SUM(DECODE(substr(month,5,4),2008,count))"2008",
SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
WHERE substr(month,1,3) = 'JUL'
GROUP BY 'July'
UNION ALL
SELECT 'August' "Month",
SUM(DECODE(substr(month,5,4),2000,count)) "2000",
SUM(DECODE(substr(month,5,4),2001,count))"2001",
SUM(DECODE(substr(month,5,4),2002,count))"2002",
SUM(DECODE(substr(month,5,4),2003,count))"2003",
SUM(DECODE(substr(month,5,4),2004,count))"2004",
SUM(DECODE(substr(month,5,4),2005,count))"2005",
SUM(DECODE(substr(month,5,4),2006,count))"2006",
SUM(DECODE(substr(month,5,4),2007,count))"2007",
SUM(DECODE(substr(month,5,4),2008,count))"2008",
SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
WHERE UPPER(substr(month,1,3)) = 'AUG'
GROUP BY 'August'
UNION ALL
SELECT 'September' "Month",
SUM(DECODE(substr(month,5,4),2000,count)) "2000",
SUM(DECODE(substr(month,5,4),2001,count))"2001",
SUM(DECODE(substr(month,5,4),2002,count))"2002",
SUM(DECODE(substr(month,5,4),2003,count))"2003",
SUM(DECODE(substr(month,5,4),2004,count))"2004",
SUM(DECODE(substr(month,5,4),2005,count))"2005",
SUM(DECODE(substr(month,5,4),2006,count))"2006",
SUM(DECODE(substr(month,5,4),2007,count))"2007",
SUM(DECODE(substr(month,5,4),2008,count))"2008",
SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
WHERE substr(month,1,3) = 'SEP'
GROUP BY 'September'
UNION ALL
SELECT 'October' "Month",
SUM(DECODE(substr(month,5,4),2000,count)) "2000",
SUM(DECODE(substr(month,5,4),2001,count))"2001",
SUM(DECODE(substr(month,5,4),2002,count))"2002",
SUM(DECODE(substr(month,5,4),2003,count))"2003",
SUM(DECODE(substr(month,5,4),2004,count))"2004",
SUM(DECODE(substr(month,5,4),2005,count))"2005",
SUM(DECODE(substr(month,5,4),2006,count))"2006",
SUM(DECODE(substr(month,5,4),2007,count))"2007",
SUM(DECODE(substr(month,5,4),2008,count))"2008",
SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
WHERE UPPER(substr(month,1,3)) = 'OCT'
GROUP BY 'October'
UNION ALL
SELECT 'November' "Month",
SUM(DECODE(substr(month,5,4),2000,count)) "2000",
SUM(DECODE(substr(month,5,4),2001,count))"2001",
SUM(DECODE(substr(month,5,4),2002,count))"2002",
SUM(DECODE(substr(month,5,4),2003,count))"2003",
SUM(DECODE(substr(month,5,4),2004,count))"2004",
SUM(DECODE(substr(month,5,4),2005,count))"2005",
SUM(DECODE(substr(month,5,4),2006,count))"2006",
SUM(DECODE(substr(month,5,4),2007,count))"2007",
SUM(DECODE(substr(month,5,4),2008,count))"2008",
SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
WHERE substr(month,1,3) = 'NOV'
GROUP BY 'November'
UNION ALL
SELECT 'December' "Month",
SUM(DECODE(substr(month,5,4),2000,count)) "2000",
SUM(DECODE(substr(month,5,4),2001,count))"2001",
SUM(DECODE(substr(month,5,4),2002,count))"2002",
SUM(DECODE(substr(month,5,4),2003,count))"2003",
SUM(DECODE(substr(month,5,4),2004,count))"2004",
SUM(DECODE(substr(month,5,4),2005,count))"2005",
SUM(DECODE(substr(month,5,4),2006,count))"2006",
SUM(DECODE(substr(month,5,4),2007,count))"2007",
SUM(DECODE(substr(month,5,4),2008,count))"2008",
SUM(DECODE(substr(month,5,4),2009,count))"2009" FROM TYSON_TEST_TABLE
WHERE UPPER(substr(month,1,3)) = 'DEC'
GROUP BY 'December'Edited by: Tyson Jouglet on Mar 17, 2009 9:27 AM -
Authorization chaeck in report based on Table
My client want report to be displayed based on the Authorization. For example when user is entering Input parameters like Plant, Sales org. and executing the report it should check for the Authorization of the user for that plant and Sales org.
the reason being they don't want to allow other division to see the important data of that report. As this report is used by all the division and i can not put check in Role assignment as many of the roles are there with same t-code of report and where plant and sales org is mentioned as * in that roles.
i want to put check based on ABAP coding and write with the help of Table and Field in order to Check the Authorization of Plant and sales org for that particular USER PROFILE.
Bacause changing in the profile will have huge effect on the report functionality as this reoprt is used in ALL over india level and our client Business spread all over iNdia Level.
If anybody know how to do that can help alot.hi,
Check the foll.:
AUTHORITY-CHECK OBJECT object ID name1 FIELD f1
Explanation of IDs:
object
Field which contains the name of the object for which the authorization is to be checked.
name1 ...
Fields which contain the names of the
f1 ...
Fields which contain the values for which the
AUTHORITY-CHECK checks for one object whether the user has an authorization that contains all values of f.
Create an object say, z_auth with auth fields as plant(WERKS), Sales Org(VKORG) etc..whatever is relevant.
Now, in ur report, U can write..
say, pa_plant is a parameter in ur seln screen.
AUTHORITY-CHECK OBJECT 'ZAUTH'
ID 'WERKS' FIELD pa_plant.
IF sy-subrc NE 0.
"No authorization for plant <pa_werks>"
MESSAGE exxx WITH pa_plant.
ENDIF.
I hope this helps.
Plz Reward suitable points, if it helps.
Rgds,
Raghu. -
Generate automatic HTML Report output
Is there any methode to generate 100 Reports
in diffrent times in html format automaticaly.Yes. U can schedule the reports for different times. See the help on "schedule" command line parameter. But this will require Oracle Reports Queue manager.
-
Report based on PLSQL returning SQL query
I created function which builds the SQL and returns it as VARCHAR2. For testing purposes I harcoded the primary ID for the query to be based on. I run the function as standalone call to get the generated SQL and to test it. It works fine. The moment I try to use the ID parameter as an argument passed to the function it doesn't work and I get the "No data found" error. Again if I try this function outside of Apex it produces correct SQL syntax and it runs.
The function signature is really simple:
FUNCTION abc(i_id NUMBER) RETURN VARCHAR2
IS
l_id NUMBER;
BEGIN
-- this works:
-- l_id := 300;
-- this doesn't work:
l_id := i_id;
... more code follows. It uses the l_id while building the query.
I also tried to make it an anonymous block and place it directly in Apex region. Again I face the same problem. I modified this function slightly to reference the page attribute instead of accepting parameter:
DECLARE
l_id NUMBER;
BEGIN
-- this works:
-- l_id := 300;
-- this doesn't work:
l_id := :P65_ID;Have you verified that i_id and P65_ID have a value when the procedure runs? Perhaps have something along the lines of "if i_id is null then return 'select <dummy data> from dual' else [build real query here]"...?
-D. -
WIS 10901 error when creating a webi report based on OLAP unv (SSAS 2005)
Hi,
I'm using two VM.
Machine A is running SSAS 2005. I'm able to create SSAS cube. Everything is ok
Machine B is runing BO XIR3.1. I'm able to create webi report on relational DB without any problem or opening samples.
Both VM machines are on the same custom network and I'am able to ping both. SQL managment server studio is installed on both machines. I'm able to manage SSAS from B also and not only from A.
Creating unv with BO designer on machine B is OK, connexion is runing and universe has been created and published on the BO server
But when I create a webi report from B, using my OLAP unv based on SSAS located on machne A I recieve following error message :
Une erreur de base de données s'est produite. Le message d'erreur est le suivant : . (WIS 10901)
thanks for your help,
NicolasHi
Ya I used SAP authentication - then also get same error.
Connections are created with username, password to access SAP Source
Thanks!
J>M>Raj
Edited by: John Milton on Jun 25, 2009 10:03 AM -
Hi,
am going to generate an HTML report for a table by using below code
SET heading off
SET pagesize 80
SET MARKUP HTML ON SPOOL ON HEAD "<TITLE>Job Comparison Report</title> -
STYLE TYPE=’TEXT/CSS’><!--BODY {background: ffffc6} --></STYLE>"
SET ECHO OFF
SPOOL "C:\Jc\Reports\LoadUnmatchedCustomerHistory.htm"
select * from TB_JOB_REPORT;
SPOOL OFF
SET MARKUP HTML OFF
SET ECHO ON
its working fine.
but in my TB_JOB_REPORT table contains more than hundred accounts information also which is having only two fileds one is ACCT_NUM another one is TEXT_REPORT. i just want to geenrate individual report for each account as of now am getting all accounts information in a single report.
is there any possibility to generate a report for individual accounts.
like select * from TB_JOB_REPORT where ACCT_NUM=???, i just want to pass a loop to get corresponding account information but not sure how to implement this logic in for loop.
any ideas to do this please share me...
Thanks in advanceLast week I have played with something like below (not tested!!! not very sure I remember all :( - just to get an idea ;)
html attributes (fonts, colors, borders, ... you name it - I'm not even aware of) were filled in by others
with
the_data as
(select 1 a_number,'abc' a_string,sysdate a_date from dual union all
select 2,'qwertzuiop',trunc(sysdate) - 2 from dual union all
select 3,'qwxy',to_date(null) from dual union all
select 4,null,to_date('1.5.2000','dd.mm.yyyy') from dual union all
select null,'?',trunc(sysdate) from dual
select xmlelement("table",
xmlagg(
xmlelement("tr",
xmlelement("td",xmlattributes('right' as align), 2 * a_number),
xmlelement("td", initcap(a_string)),
xmlelement("td", to_char(a_date,'yyyy-mm-dd hh24:mi:ss'))
order by a_number desc nulls first
).getclobval()
from the_dataRegards
Etbin
Maybe you are looking for
-
I can't save anything to my hard drive. I get a permissions denied message.
This problem showed up out of nowhere. It began right before I installed Lion. Installing Lion didn't fix the problem. I am able to save work to my dropbox folder, but I can't save to my documents folder. I've tried restarting my computer. It didn't
-
UndoManager doesn't work when TextArea focusOut
Hello, UndoManager no longer works when the textArea focusOut and I return in the textarea, the history is erased. <!-- Simple example to demonstrate the Spark List component --> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="librar
-
Creating dependent select list menus with javascript
Hi Everybody, I m creating parent and child select list menu. Value of Child menu would be dependent on the value selected in the parent menu. I have tried to implement a code from adobe labs (http://kb2.adobe.com/cps/149/tn_14924.html) but many str
-
Mixed Data Type Table Control for Data Entry
Hi Guys -- I'm attempting to do error-checked data entry, My data is mixed: path, boolean, and numeric. The natural organization is an array of clusters. For instance, the cluster element would look like "path, boolean, numeric, numeric" and I wou
-
BI Publisher Java API not displaying Barcode in PDF Report
Hi Team, I have used BI Publisher java API in my ADF Application to generate PDF reports. It is not displaying barcodes in the PDF Reports. I have included Code 39 ttf file in my java home as well. Please let me know if any other configuration needs