Required empty row return
Dear All,
I need some help from you. Please kindly help me. I am working in jasper report 1.2.2. I need to make a report. Report will be like this (given bellow):
header
Col head 1 Col head 2 Col head 3 Col head 4
Static Data Query Data1 Query Data1 Query Data1 Details
Static Data Query Data2 Query Data2 Query Data2
Static Data Query Data3 Query Data3 Query Data3
Static Data Query Data4 Query Data4 Query Data4
Static Data Query Data5 Query Data5 Query Data5
Static Data Query Data6 Query Data6 Query Data6
Footer
Page:1
header
Col head 1 Col head 2 Col head 3 Col head 4
Static Data Query Data1 Query Data1 Query Data1 Details
Static Data Query Data2 Query Data2 Query Data2
Static Data
Static Data
Static Data
Static Data
Footer
Page:2
Sample report: http://202.65.11.33/sample.jsp
Its just a simple query like select * from emp. But using this query my second pages result is coming like this.
Header
Col head 1 Col head 2 Col head 3 Col head 4
Static Data Query Data1 Query Data1 Query Data1 Details
Static Data Query Data2 Query Data2 Query Data2
Footer
Page:2
Jasper Report cant provide this facility like this fixed format. Other reporting tools like developer, crystal etc. can support fixed format facility in details section. Anyway, now I dont know how to solve this problem. Is there any solution, using query which will return blank or null data in those fields.
I really appreciate it if somebody helps me in advance.
Thank you
(select rn from (select rownum rn from dual connect by rownum<=6)) statics 6 where statics.rn = t.key (+)Thank you for this....works great when needing to force 1 row to return 100% of the time
amongst varying criteria (adjusting 6 down to 1 of course). --Kate
Similar Messages
-
HGrid line detail is returning empty rows
Hi All,
I am working with HGrid component. I have followed OAF Developer Guide information as follows.
1. Created 2 VOs like PoHeaderVO, POLineVO
2. Created VL with HEADER_ID as source attribute and dest attribute
3. Added a HGrid component
4. Added a Tree component as Child to Hgrid
5. Set ViewInstnace and ViewAttribute to nodeDef1
6. Set ancestor name and view link instance name to childNode1
I am able to run the page. It is showing all header detail. When i expand the header details, it showing the respective number of empty rows for line details.
Anybody can suggest me, what is missed?
Thanks in Advance.
Purushoth...Hi..
Any input for this issue...
Thanks in advance..
Regards,
Purushoth -
Question:
There is a scenario that users want to send multiple rows returned by Execute SQL Task as Email content to send to someone. With Execute SQL Task, the Full result set is used when the query returns multiple rows, it must map to a variable of the Object data
type, then the return result is a rowset object, so we cannot directly send the result variable as Email content. Is there a way that we can extract the table row values that are stored in the Object variable as Email content to send to someone?
Answer:
To achieve this requirement, we can use a Foreach Loop container to extract the table row values that are stored in the Object variable into package variables, then use a Script Task to write the data stored in packages variables to a variable, and then set
the variable as MessageSource in the Send Mail Task.
Add four variables in the package as below:
Double-click the Execute SQL Task to open the Execute SQL Task Editor, then change the ResultSet property to “Full result set”. Assuming that the SQL Statement like below:
SELECT Category, CntRecords
FROM [table_name]
In the Result Set pane, add a result like below (please note that we must use 0 as the result set name when the result set type is Full result set):
Drag a Foreach Loop Container connects to the Execute SQL Task.
Double-click the Foreach Loop Container to open the Foreach Loop Editor, in the Collection tab, change the Enumerator to Foreach ADO Enumerator, then select User:result as ADO object source variable.
Click the Variable Mappings pane, add two Variables as below:
Drag a Script Task within the Foreach Loop Container.
The C# code that can be used only in SSIS 2008 and above in Script Task as below:
public void Main()
// TODO: Add your code here
Variables varCollection = null;
string message = string.Empty;
Dts.VariableDispenser.LockForWrite("User::Message");
Dts.VariableDispenser.LockForWrite("User::Category");
Dts.VariableDispenser.LockForWrite("User::CntRecords");
Dts.VariableDispenser.GetVariables(ref varCollection);
//Format the query result with tab delimiters
message = string.Format("{0}\t{1}\n",
varCollection["User::Category"].Value,
varCollection["User::CntRecords"].Value
varCollection["User::Message"].Value = varCollection["User::Message"].Value + message;
Dts.TaskResult = (int)ScriptResults.Success;
The VB code that can be used only in SSIS 2005 and above in Script Task as below, please note that in SSIS 2005, we should
change PrecompileScriptIntoBinaryCode property to False and Run64BitRuntime property to False
Public Sub Main()
' Add your code here
Dim varCollection As Variables = Nothing
Dim message As String = String.Empty
Dts.VariableDispenser.LockForWrite("User::Message")
Dts.VariableDispenser.LockForWrite("User::Category")
Dts.VariableDispenser.LockForWrite("User::CntRecords")
Dts.VariableDispenser.GetVariables(varCollection)
'Format the query result with tab delimiters
message = String.Format("{0}" & vbTab & "{1}" & vbLf, varCollection("User::Category").Value, varCollection("User::CntRecords").Value)
varCollection("User::Message").Value = DirectCast(varCollection("User::Message").Value,String) + message
Dts.TaskResult = ScriptResults.Success
End Sub
Drag Send Mail Task to Control Flow pane and connect it to Foreach Loop Container.
Double-click the Send Mail Task to specify the appropriate settings, then in the Expressions tab, use the Message variable as the MessageSource Property as below:
The final design surface like below:
References:
Result Sets in the Execute SQL Task
Applies to:
Integration Services 2005
Integration Services 2008
Integration Services 2008 R2
Integration Services 2012
Integration Services 2014
Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.Thanks,
Is this a supported scenario, or does it use unsupported features?
For example, can we call exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='b64ce7ec-d598-45cd-bbc2-ea202e0c129d'
in a supported way?
Thanks! Josh -
Print Empty rows in a Template
Hi All,
my requirement is to create a template for payslip, which contains earnings, deductions & Net Amount.
If an employee has 10 earnings and 6 deductions and another employee has 3 earnings and 2 deductions then the Template is differ's based on the data.
For both the employees, the template should look same, so by inserting empty rows, i think it is solved...
How to insert Empty Rows in the Template?
Did anyone get this working and knows what I am doing wrong?
Regards,
DilipI think the query is not returning all the data desired.
You need a zero value for each deduction/earning per employee in the query results.
To get the query to give all the necessary zeros I would do a union that is simply all the employees returned in the first part of the query matched up with the table(s) that have all the deduction and earnings fields.
Of course the amount of the earnings or deductions would simply be an expression - zero.
Then when the data is run against the xmlp template, it would have to sum the values.
This would make all the reports come out the same.
The way to think about the the xmlp template is that it does a loop/filter through your data.
If your loop is on employee - it is only going to return the rows with that employee.
If that employee does not have a certain deduction then it will not show up.
If your loop is on deduction or earnings - it is only going to return the rows with that employee.
Now if you have a fixed list of deductions/earnings then you can code this into the xmlp template - tedious, but it will work.
If your deductions/earnings ever change, you will have to perform maintenance on the report. -
How can I create an empty row on a #TempTable based on an input parameter
So if my Line of Business is 'MC' or 'MG', I have to go over to Oracle and get its data accordingly. Then, when I create my final report result set, I think I'll want to UNION in that result set if my Parameter is 'MC' or 'MG'. I don't think I can UNION
based on the value of the Parameter. So my thought process was to create an empty row on my #TempTable so when I UNION and my parameter is NOT 'MC' or 'MG' then it will have nothing to UNION in. My struggle is how do I create an empty row in my #TempTable
if my parameter is NOT 'MC' or 'MG'
If I am wwwaaayyy off here, please tell me so.
This is my #TempTable Creation SQL...
IF EXISTS
(SELECT 1
FROM [#TempTable_LineOfBusiness_Parameter]
WHERE [#TempTable_LineOfBusiness_Parameter].[RESULT] IN ('MC','MG'))
BEGIN
SELECT *
INTO [#TempTable_Market_Prominence_Member_Data]
FROM OPENQUERY
(RPDMHF,
'SELECT HCFA_NAME_ORG.NAME_ID,
HCFA_NAME_ORG.MEMBER_ID,
HCFA_NAME_ORG.HIC_NUMBER,
MEMBER.NAME_FIRST,
MEMBER.NAME_LAST,
HCFA_DATE.START_DATE,
HCFA_DATE.END_DATE,
HCFA_NAME_ORG.COUNTY_CODE,
HCFA_NAME_ORG.PART_A_PAYMENT,
HCFA_NAME_ORG.PART_B_PAYMENT,
HCFA_NAME_ORG.STATUS,
HCFA_NAME_ORG.ORG_ID,
HCFA_NAME_ORG.PLAN,
HCFA_NAME_ORG.ENROLL_DATE,
HCFA_NAME_ORG.PBP_ID,
HCFA_DATE.VALUE
FROM SC_BASE.HCFA_DATE
LEFT JOIN SC_BASE.HCFA_NAME_ORG
ON HCFA_NAME_ORG.NAME_ID = HCFA_DATE.NAME_ID
LEFT JOIN AMIOWN.MEMBER
ON TRIM(MEMBER.MEMBER_NBR) = TRIM(HCFA_NAME_ORG.MEMBER_ID)
WHERE HCFA_DATE.INDICATOR = ''plan''
AND HCFA_DATE.START_DATE >= ''2015-01-01''
END
If I add an ELSE, it always comes back and tells me the #TempTable_Market_Prominence_Member_Data already exists. As if it's creating it regardless of the Top IF.
Thanks for your review and am hopeful for a reply.Hi ITBobbyP,
The error came back from your ELSE Statement most probably caused by the reason mentioned in Hoffmann's post.
Regarding your requirement, I would suggest you CREATE the [#TempTable_Market_Prominence_Member_Data] explicitly.
CREATE TABLE [#TempTable_Market_Prominence_Member_Data]
NAME_ID INT,
MEMBER_ID INT,
HIC_NUMBER VARCHAR(99),
NAME_FIRST VARCHAR(99),
NAME_LAST VARCHAR(99),
START_DATE DATE,
END_DATE DATE,
COUNTY_CODE VARCHAR(99),
PART_A_PAYMENT MONEY,
PART_B_PAYMENT MONEY,
STATUS VARCHAR(99),
ORG_ID INT,
PALN VARCHAR(99),
ENROLL_DATE VARCHAR(99),
PBP_ID INT,
VALUE INT
IF EXISTS
(SELECT 1
FROM [#TempTable_LineOfBusiness_Parameter]
WHERE [#TempTable_LineOfBusiness_Parameter].[RESULT] IN ('MC','MG'))
BEGIN
INSERT INTO [#TempTable_Market_Prominence_Member_Data]
SELECT *
FROM OPENQUERY
(RPDMHF,
'SELECT HCFA_NAME_ORG.NAME_ID,
HCFA_NAME_ORG.MEMBER_ID,
HCFA_NAME_ORG.HIC_NUMBER,
MEMBER.NAME_FIRST,
MEMBER.NAME_LAST,
HCFA_DATE.START_DATE,
HCFA_DATE.END_DATE,
HCFA_NAME_ORG.COUNTY_CODE,
HCFA_NAME_ORG.PART_A_PAYMENT,
HCFA_NAME_ORG.PART_B_PAYMENT,
HCFA_NAME_ORG.STATUS,
HCFA_NAME_ORG.ORG_ID,
HCFA_NAME_ORG.PLAN,
HCFA_NAME_ORG.ENROLL_DATE,
HCFA_NAME_ORG.PBP_ID,
HCFA_DATE.VALUE
FROM SC_BASE.HCFA_DATE
LEFT JOIN SC_BASE.HCFA_NAME_ORG
ON HCFA_NAME_ORG.NAME_ID = HCFA_DATE.NAME_ID
LEFT JOIN AMIOWN.MEMBER
ON TRIM(MEMBER.MEMBER_NBR) = TRIM(HCFA_NAME_ORG.MEMBER_ID)
WHERE HCFA_DATE.INDICATOR = ''plan''
AND HCFA_DATE.START_DATE >= ''2015-01-01''
END
Explicitly creating the temp table will offer below benefit in this case.
The ELSE statement is no longer needed, if the no rows get inserted into that table, it has nothing to union an empty table.
With the column datatype defined, you can avoid such conversion error
SELECT NULL AS COL1,NULL AS COL2 INTO #T
SELECT COL1,COL2 FROM #T
UNION
SELECT 1,'ABC'--Conversion failed when converting the varchar value 'ABC' to data type int.
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support -
Query against materialized view from stored procedure brings back empty row
I have a stored procedure that runs a query against a materialized view. When I run the query outside the SP it works just fine. When I change the MV to a table name, the SP works. When I change it back to the MV i get an empty row. Any ideas? The code is below:
PROCEDURE getAuth (p_naid IN NUMBER,
p_scope IN VARCHAR2,
o_xml_data OUT SYS_REFCURSOR
) IS
BEGIN
IF p_scope = 'Approved' THEN
OPEN o_xml_data FOR
SELECT naid,
p_naid,
auth_type,
xml_data
FROM some_mv
WHERE naid = p_naid;
RETURN;
CLOSE o_xml_data;
... the rest of the procedure ...does procedure contain EXCEPTION handler?
if so, then remove, delete & eliminate EXCEPTION handler (at least during testing & debugging) -
Inserting static text in between rows returned from a pivot table
Is there a way to type static text (eg. “Note that the data for Land has an accuracy of 98%”) in between rows returned from the dataset in the rtf template. The alternative would be to break the BI analysis report (which is the source of the template data) into 2 parts and then insert each part into the template one below the other with the text typed in between.
Oracle support has confirmed that this requirement is not possible to implement
-
How to add empty rows in table in smart form
how to add empty rows in table in smart form?
plz help me regarding this
send me ur queries to [email protected]You will need to add some extra rows to the internal table that your table is displaying. Use a program node to append additional rows with a key but no argument.
Alternaively a template may me more suitable for your requirement than a table.
Finally, please do not include you e-mail address in your question. Your question and the answers provided to it are for the benefit of everyone in the Community.
Regards,
Nick -
Preventing empty rows in address formats
Hallo everyone!
I'd like to know if there is a method to prevent SBO2005A from printing empty rows in the address fields when for instance there is missing county in BP addresses like this:
I have defined an address format that goes
Block
County
Street
ZipCode | Freetext(" ") | City
We use Block as "Name2" and County as "Name3" in master data just in case the customer wants to use additional names for his BPs.
If I use the "Block" - field and I leave the "County" - field blank it prints an empty row between "Block" and "Street". This is not the behaviour I would like to see. In case "county" is missing I would rather see something like this in a printout:
Block
Street
ZipCode | Freetext(" ") | City
So, is there a method to force this? or any workaround?Hello Patryk,
PLD does not offer the functionality to control the blank lines in an address field. I would suggest you use a formatted search in your address field on the marketing document and have it formatted in the document itself before you print.
Please see sample code for your requirment for the Ship to address. If you want this to applied to the Bill to address field then you have to slight alter the query by cha
For Shipto address formatting
SELECT CASE WHEN T0.Block IS NOT NULL THEN + CHAR(13) + CHAR(10) + T0.Block + CHAR(13) + CHAR(10) ELSE '' END +
CASE WHEN T0.County IS NOT NULL THEN + CHAR(13) + CHAR(10) + T0.County + CHAR(13) + CHAR(10) ELSE '' END +
ISNULL(T0.Street, '') + CHAR(13) + CHAR(10) + ISNULL(T0.ZipCode, '') + ' ' + ISNULL(T0.City, '')
FROM [dbo].[CRD1] T0 WHERE T0.AdresType = 'S' AND T0.Address = $[$40.0.0] AND T0.CardCode = $[$4.0.0]
For Billto address formatting
SELECT CASE WHEN T0.Block IS NOT NULL THEN + CHAR(13) + CHAR(10) + T0.Block + CHAR(13) + CHAR(10) ELSE '' END +
CASE WHEN T0.County IS NOT NULL THEN + CHAR(13) + CHAR(10) + T0.County + CHAR(13) + CHAR(10) ELSE '' END +
ISNULL(T0.Street, '') + CHAR(13) + CHAR(10) + ISNULL(T0.ZipCode, '') + ' ' + ISNULL(T0.City, '')
FROM [dbo].[CRD1] T0 WHERE T0.AdresType = 'B' AND T0.Address = $[$226.0.0] AND T0.CardCode = $[$4.0.0]
Suda -
Replacing the "No rows returned" message in Portlets
Hi all,
How to remove (or replace) the default message that comes in each Portlet if the query doesnot return anything ? By default the Portlet shows the message "No rows returned" , how to customize it or remove it.
AymanIt's not possible to replace this message, but you can do a such workaround :
if your portlet (s) are built from SQL query, change it so :
select a1,a2,a3 from table ...
UNION
select null a1,null a2,null a3 from dual
In this case your query is not empty, so you're able to bide the mentioned message.
Hope, it helps.
Izabella. -
No rows returned when using sql in XQuery.
Hi all,
I have a small table on a db with seven cols and three rows. I am doing the following xquery, but the db is returning an empty rowset when I know there sould be 3.
<WebPage>
for $i in sqlquery("select * from project")/row
return
<project>
{$i/title}
{$i/image}
{$i/icon}
{$i/version}
{$i/start_date}
{$i/home}
{$i/address}
</project>
</WebPage>
There is no problem with the db connection, as it is one I have used before for doing plain sql searches remotely. Does any one know why this would be happening?
Regards,
SimonHi Bart,
try this.....
To execute such XQuery queries that use the sqlquery function, you would need to initialize the Java connection information in the XQueryContext before executing the query. For example, your Java program would be something like this,
// get the connection (for example, using the thick JDBC Driver)
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn =
DriverManager.getConnection("jdbc:oracle:@","scott","tiger");
// create a context using that connection..
XQueryContext ctx = new XQueryContext(conn);
// create a string from the file
Reader strm = new StringReader(
"FOR $i IN sqlquery(\"select * from scott.emp\")/ROW "+
" RETURN <EMP empno=\"{$i/EMPNO}\">$i/ENAME,$i/SALARY</EMP>");
// prepare the query
PreparedXQuery xq = ctx.prepareXQuery(strm);
// get a resultset
XQueryResultSet rset = xq.executeQuery();
while (rset.next())
XMLNode node = rset.getNode(); // get result nodes
System.out.println(" NODE "+ node.getNodeName());
node.print(System.out);
source:==>http://otn.oracle.com/sample_code/tech/xml/xmldb/jxqi.html
Good luck
Achim -
No rows returned in GC Reports
Hi all,
I created my own report with the body as the following:
Table from SQL:
select * from sys.aud$ where to_char(ntimestamp#, 'DD-MON-YYYY')='18-NOV-2008'
I granted select on sys.aud$ to SYSMAN and MGMT_VIEW users in my TEST database.
When I am trying to run the report, it returns the empty table saying: "No rows returned", while there a lot of records:
17:13:17 db_manager@test> select count(*) from sys.aud$;
COUNT(*)
559859
Elapsed: 00:00:00.10
17:13:26 db_manager@test>
Does anybody know what I am missing here?
Thanks a lot in advance!
M.Hi, DBMS Direct.
thank you for writing to me.
could you please suggest how to check and to make sure that it queries the correct DB?
When I click on Edit button, In General tab in Targets I check the second radio button: Use the specified target and then i click on a flashlight and pick my DB. Whatever database I pick, the result is the same: no rows selected... Smells like it queries itself (repository)...
Please, advise, Im fighting for about two weeks now..
Thanks in advance,
M. -
when I use the decode function I always get extra empty rows in my results. Why is this? Is it because I don't use a default value?
I always have to use a where statement to eliminate those empty rows, like in the following statement.
select
decode(table.field1,'field1value','output')
from
table
where
table.field1='field1value'Let me try to explain using your example:
SQL> create table mytable
2 as
3 select 'Weight' field1, '2' field2 from dual union all
4 select 'Colour', 'red' from dual union all
5 select 'Size', 'L' from dual
6 /
Tabel is aangemaakt.So, the table has three rows.
SQL> select decode(Field1,'Weight',Field2)
2 from mytable
3 /
DEC
2
3 rijen zijn geselecteerd.Since you don't have a where clause, you don't restrict the number of rows returned. The row appears empty because of the decode function, which says: "if field1 is equal to 'Weight' then display field2 else display nothing".
SQL> select field1
2 , field2
3 , decode(Field1,'Weight',Field2)
4 , decode(Field1,'Weight',Field2, field1)
5 from mytable
6 /
FIELD1 FIE DEC DECODE
Weight 2 2 2
Colour red Colour
Size L Size
3 rijen zijn geselecteerd.This shows that the rows are not empty, only the third column is. The fourth column is a similar decode function but with a fourth argument that additionally says "if field1 is not equal to 'Weight' then show me field1 instead of field2"
But I guess you really want one row, the row containing 'Weight', which can be easily achieved by a where clause:
SQL> select field2
2 from mytable
3 where field1 = 'Weight'
4 /
FIE
2
1 rij is geselecteerd.Hope this clarifies.
Regards,
Rob. -
Empty Row ?????
Hi
I have a page with a grid with Record name My_Record. Grid delivered add row is not used instead a custom add Button is present below the grid to add a row .
On Field Change of Custom Add Button :
&Rowset0 = GetLevel0();
&Rowset1 = &Rowset0(1).GetRowset(Scroll.My_Record);
&Rows = &Rowset1.ActiveRowCount;
If &Rows = 1 And
&Rowset1(1).IsNew Then
&NewRowNumber = 1; /* component variable to track current row */
Else
&Rowset1.InsertRow(&Rows);
&NewRowNumber = &Rows + 1; /* component variable to track current row */
End-If;
&RETURN_MODAL = DoModal(Page.MY_SEC_PAGE, "", - 1, - 1, 1, Record.My_Record, &NewRowNumber);
but when i save first time , it always going to save an additional empty row in the record.
How an empty row is bieng inserted ?
On page there is no field on Level0 , if this is the issue ?Problem Solved....
There was another Page in the Component which was no longer required. It had fields of this Record at Level 0 so when Save was called, it saved an Empty Row.
Edited by: Mohsin on Aug 15, 2012 4:52 PM -
Custom "no row returned" message
hi all,
is there a way to change the "no row returned " message in the report?
I want to translate it in french!
thks for helpYou can try to do such thing : create your query like
select a1 f1,a2 f2, ... from table
UNION
select null f1,null f2,... from dual
In this case if you don't have real records you get an empty record, so the mentioned message diappears.
Maybe you are looking for
-
Missing Tools. ACK! Help!
At work I'm using CS5 on a Mac. Today I tried installing a new brush and after doing so all my tools went away, and I mean ALL of them. Looking under the WINDOW menu the only things tht are listed are: New Window, Arrange, Application Frame, Applicat
-
The new cover flow style in ios 7 is not as nice as the ios 6??
iOS7, why Apple designed such a lack thing like this?? ****!! it doesn't feel so as comfortable as the iOS6. I really like iOS 6 than iOS7, but there is no way to turn back,, so hopeless!! and the iOS is like a copying of Microsoft's Windows 8, why A
-
Ultra 24 with 2TB Drives? (Anyone try it?)
Hi, Has anyone had success with using 2TB drives in the Ultra 24? What have people installed and Had success with? The manual says 750GB drive but a max capacity of 4TB, which would be 4x1TB but that is Sun... Oracle for you. I will not purchase thes
-
E66: "press unlock to activate keypad" issue
hi, i've been using the phone for a few months now and i noticed recently that sometimes,when i lock the keypad, i get the "press unlock to activate keypad" message, on and on, without me touching any buttons at all. It just keeps appearing very r
-
Want help in developing my first game in java!!
I want to develop a tetris game in java..can any one help me on this..basically i m new to java programming, i want to know abt the graphical part ..how to make that.. i will code the rest..I want to make an application rather than an applet..