Comma delimited report script
Hi All,
Is there an "unofficial" way to export a report script with comma as the delimiter?
We are trying to load data from Analytic Services 9.2 into Enterprise and need to automate the process. However this is proving difficult since the only delimiter seems to be a tab and we need a comma delimited file.
Thanks for your help.
Seb
Have a read of Re: CSV format file through Report scripts.
Cheers
John
http://john-goodwin.blogspot.com/
Similar Messages
-
Trying to email comma delimited report as filename.csv
I have a report that is going to be e-mailed to users, and I have it set up with the following parameters:
DESTYPE=mail
DESNAME=entered at runtime
DESFORMAT=DELIMITED
DELIMITER=,
The only thing that I am trying to figure out is if there is a way to define the file name. It defaults it to the reportname.txt. Is there a way to define the filename as filename.csv?
Thanks!Hi Jenny,
You could use the distribution feature of Oracle Reports to define the attachment file name. If you are using Reports 9i or 10g, you can define the following in distribution.xml file (just an example):
<destinations>
<mail id="ex1"
to="<DestinationEmailAddress>"
from="<OriginEmailAddress>"
subject="This mail contains ...">
<body srcType="text">
This is the body of the message.
</body>
<attach format="ascii" name="reportname.csv" srcType="report" >
<include src="mainSection"/>
</attach>
</mail>
</destinations>
And the report as http://machine..../reports/rwservlet?....distribute=yes+destination=distribution.xml
Pl take a look at the detailed information in Publishing Reports 10g Chapter 15:
http://www.oracle.com/technology/documentation/reports.html
Navneet. -
CSV format file through Report scripts.
Hello Gurus -
In hyperion report scripts we can use the "Tabdelimited" syntax to produce the extract where the columns are separated by tabs.
I was wondering if there is a way to get the columns separated by "Comma" instead of Tabs through the report scripts.
Any guidance is appreciated.
Thanks in advance.
RegardsTo produce comma separed report script you could use the MASK command and fixed column lengths.
If you have a read of :- http://download.oracle.com/docs/cd/E12825_01/epm.111/esb_techref/rw_mask.htm
It gives an example of producing comma separated report.
Cheers
John
http://john-goodwin.blogspot.com/ -
Report script issue - showing comma in numbers
Good Morning,
I have a report script that runs on one Essbase cube and produces a datafile to load into a Planning cube via a load rule. The issue is that when I load the datafile into Planning, it says it is loaded successfully but not all of the data loads. I also do not recieve an error log. I have checked the datafile and all of the relevant data is stored. I believe that the issue is that the report script has commas in the numbers. The load rule replaces the comma with a space, but I believe this is causing an issue with the load. Perhaps there is an extra comma somewhere in the file and when the load rule loads the file, it thinks it has finished.
My question is, how do I remove the commas within the numbers in the report script? Below is a portion of the report script.
// This portion of the script captures data at level 2 and generation 9 within the four operating divisions to get all field level data
<LINK (( <DESCENDANTS ("RC_P1301008017","Lev2,Entity") or <DESCENDANTS ("RC_P1301008019","Lev2,Entity") or <DESCENDANTS ("RC_P1301008021","Lev2,Entity")
or <DESCENDANTS ("RC_P1301008029","Lev2,Entity")) and <DESCENDANTS ("RC_P1201008065","Gen9,Entity"))Do you use a { SUPCOMMAS } in your report script? That should suppress all commas in data values.
http://docs.oracle.com/cd/E17236_01/epm.1112/esb_tech_ref/rw_supcommas.html
You might also think about SUPALL:
http://docs.oracle.com/cd/E17236_01/epm.1112/esb_tech_ref/rw_supall.html
FWIW, I had a Planning app like this last year. The importing of the report script output into Access (oh, the horror) to do moderately intensive mapping and aggregating was...painful. The only cool part was that I was "not allowed to source data from the app" but I could "run any retrieve I wanted so long as security allowed it". Hmm, how is that different? Okay then, report scripts are it. ;)
Regards,
Cameron Lackpour -
Report script question : Tabs in headers
I'm trying to write a report script in such a way that I can generate a tab-delimited file and have the end user import it directly into Excel just the way they want.The problem is I need a custom header. Using the {TABDELIMIT} option only tab delimits the data rows and not the headers. Does anyone have a suggestion on how to use a Tab character in a custom header?I'd appreciate any suggestions.Thanks for your time.Jeff BaumertSr. Programmer AnalystFrontier585-777-7344
I think the EUROPEAN keyword should do it.
See: http://download.oracle.com/docs/cd/E12825_01/epm.111/esb_techref/rw_european.htm
Regards,
Cameron Lackpour -
Import Format for Separte Debit and Credit Columns (comma delimited file)
I have a file that is comma delimited with a sparate debit column and a separate credit column:
Sample:
Ent,Acct,description,Dr,Cr
,1000,test,100,
,110010,another test,,100
My import format is this:
Comma delimited
Field Number Number of Fields Expression
Entity 1 5 SGB_ABC
Account 2 5
Amount 5 5 Script=DRCRSplit_Comma_Del.uss
I've tried writing the following script to pull the amount from the debit column into the credit column but it just skips the lines with no amount in field 5.
'Declare Variables
Dim Field4
Dim Field5
'Retrieve Data
Field4 = DW.Utilities.fParseString(strRecord, 4, 4, ",")
Field5 = DW.Utilities.fParseString(strRecord, 5, 5, ",")
'If Field4 has a value then fld 5 is to equal fld 4.
If IsNumeric(Field5) Then
Field5 = Field5
Else
Field5 = Field4
End If
'Return Result into FDM
SQFLD5 = Field5
End Function
Can anyone tell me what I am doing wrong?
Thanks!I got it to work using this script:
Function DRCR_Comma_Del(strField, strRecord)
'Hyperion FDM DataPump Import Script:
'Created By: testuser
'Date Created: 7/22/2009 9:31:15 AM
'Purpose: If Amount is in the DR column move it to the CR amount column.
Dim DR
Dim CR
DR = DW.Utilities.fParseString(strRecord, 5, 4, ",")
CR = DW.Utilities.fParseString(strRecord, 5, 5, ",")
If IsNumeric(DR) Then
strField = DR
Else
strField = "-" & CR
End If
DRCR_Comma_Del = strField
End Function -
Ssrs 2012 export to comma delimited (csv) file problem
In an ssrs 2012 report, I want to be able to export all the data to a csv (comma delimited) file that only contains the detailed row information. I do not want to export any rows that contain header data information.
Right now the export contains header row information and detail row information. The header row information exists for the PDF exports.
To have the header row not exist on CSV exports, I have tried the following options on the tablix with the header row information with no success:
1. = iif(Mid(Globals!RenderFormat.Name,1,5)<>"EXCEL",false,true),
2. = iif(Mid(Globals!RenderFormat.Name,1,3)="PDF",false,true),
3. The textboxes that contain the column headers, the dataelelementoutput=auto and
the text boxes that contain the actual data, I set the dataelelementoutput=output.
Basically I need the tablix that contains the header information not to appear when the export is for a csv file.
However when the export is for the detail lines for the csv export, I need that tablix to show up.
Thus can you tell me and/or show me code on how to solve this problem?Hi wendy,
Based on my research, the expression posted by Ione used to hide items only work well when render format is RPL or MHTML. Because only the two render format’s RenderFormat.IsInteractive is true.
In your scenario, you want to hide tablix header only when export the report to csv format. While CSV file uses the textbox name in detail section as the column name, not the table header when you view the table. So if we want to hide the header row of the
tablix, please refer to the steps below to enable the “NoHeader” setting in the RSReportserver.config file:
Please navigate to RSReportserver.config file: <drive:>\Program Files\Microsoft SQL Server\MSRS1111.MSSQLSERVER\Reporting Services\ReportServer \RSReportserver.config.
Backup the RSReportserver.config file before we modify it, open the RSReportserver.config file with Notepad format.
In the <Render> section, add the new code for the CSV extension like this:
< Extension Name="CSV" Type="Microsoft.ReportingServices.Rendering.DataRenderer.CsvReport,Microsoft.ReportingServices.DataRendering">
<Configuration>
<DeviceInfo>
<NoHeader>True</NoHeader>
</DeviceInfo>
</Configuration>
< /Extension>
Save the RSReportserver.config file.
For more information about CSV Device Information Settings, please see:
http://msdn.microsoft.com/en-us/library/ms155365(v=sql.110)
If you have any other questions, please feel free to ask.
Thanks,
Katherine xiong
If you have any feedback on our support, please click
here.
Katherine Xiong
TechNet Community Support -
Hi there again, I test the report script to export data to SQL, for example, on Demo - Basic db, the text file is generated as this:
New York Stereo Sales 1000.0 950.0
New York Stereo Cost of Goods Sold 580.0 551.0
New York Stereo Margin 420.0 399.0
However when import to sql, I still get everything in one big column, any idea?
<PAGE(Scenario)
<COLUMN(Year)
<ROW(Market, Product, Accounts)
<CHILD East
<DESC Product
{ DECIMAL 1
WIDTH 9
SUPBRACKET
SUPCOMMA
MISSINGTEXT " "
UNDERSCORECHAR " "
SUPHEADING
NOINDENTGEN
SUPFEED
ROWREPEAT }
Budget
Jan Feb
<DESC Accounts
!Don, I haven't followed all of your other threads so I'm not sure what tool you're using to import the .txt file to your relational database.
However, the problem is probably that your import tool isn't recognizing where one field ends and another begins. Pretty much every import tool has a method for specifying the column widths, or to use a delimiter - for example, specify tab delimiters and use {TABDELIMIT} in your report script. -
Report script -no () .
hi all
in my report script
i have mentioned
Row repeat
width
decimal
supfeed
supheading
supcommas
supmissingrows
tab delimited
noindentgen
outmembernames
supemptyrows
but i dint menetion any where abt Brackets
even though in my out put file contains its negitive value it goes in brakets ()
can help?reply is
{ supBrackets} -
Report Script related question
Hi Experts,
I have written a report script in which I am using the {TABDELIMIT} formatting command, to get the output file as tab delimited. I am facing an issue when I use the <REPMBRALIAS command in my script because the output of this command is Member name followed by a space and then alias. This makes my file inconsistent in terms of the delimeter.
Is there any command in report script using which I can get the member name followed description seperated by a tab? My requirement is to take an extract of all level 0 accounts along with their descriptions for all cost centres in a delimited format so that I could further load it into FDM.
Thanks & Regards!Thanks a loads for the replies everyone! The accounts have been poorly designed or no one would have thought that existing Essbase system would be replaced by HFM one fine day. Earlier data movement of Budget/Forecast data was from cube to cube, so that's usual stuff.
But now with Hyperion Planning to HFM integration, there is a requirement of drilling back to source file as its really difficult for the users to see accounts codes and understand the numbers.
The account codes are inconsistent too, combination of codes, strings with spaces and what not. It's time to create a new report writer command!
Thanks & Regards! -
Group Membership report script - Modify to change format of output
Hi all,
Slowly getting to grips with Powershell. Such a powerful tool.
I've been tasked to develop a reporting script that will output a list of members of a set of groups and have found one of the scripts here to be a great starting point.
So this is the script:
"Import-Module ActiveDirectory
cd AD:
$MemberList = New-Item -Type file -Force “C:\Scripts\GroupMembers.csv”
Import-Csv “C:\scripts\grps.csv” | ForEach-Object {
$GName = $_.Samaccountname
$group = Get-ADGroup $GName
$group.Name | Out-File $MemberList -Encoding Unicode -Append
foreach ($member in Get-ADGroupMember $group) {$member.SamaccountName | Out-File $MemberList -Encoding Unicode -Append}
$nl = [Environment]::NewLine | Out-File $MemberList -Encoding ASCII -Append
The output lists the group name and the members of said group using Sam account name.
Ideally I would like that the email address of the user be in the output instead of SAMACCOUNTNAME however I realise that this may not easily be achievable due to the output of get-adgroupmember.
I'd also like if the output contained each of the email addresseses of the group members to be on the same line seperated by a semicolon in one cell directly under the group name.
EG:
GROUPNAME1
[email protected];[email protected];[email protected]
GROUPNAME2
user15:mail.com
Etc
Can either of these requirements be achieved from modifying the script above and any help would be much appreciated.
Thanks for any assistance.You're welcome, glad I could help out.
Here's the same code with some comments and syntax links:
# Import the CSV file and process each record
Import-Csv .\grps.csv | ForEach {
# Set the group name as a variable for easy use later
# This really isn't necessary, but I do it for easy reading
$groupName = $_.SamAccountName
# Get the group members of the current group and process each user
# The output of this loop will be stored in a single variable
$groupMembers = Get-ADGroupMember -Identity $groupName -Recursive | ForEach {
# Get the user account and select only the EmailAddress property
Get-ADUser -Identity $_.SamAccountName -Properties EmailAddress |
Select -ExpandProperty EmailAddress
# Create a hashtable from the data above
# The group members are sorted and then joined using ; as a delimiter
$props = @{
GroupName = $groupName
Members = ($groupMembers | Sort) -join ';'
# Create a new object based on the hashtable above
New-Object PsObject -Property $props
} | Select GroupName,Members | Export-Csv .\groupMemberships.csv -NoTypeInformation
# Select is used to ensure the correct column order and then an output CSV is created
http://ss64.com/ps/import-csv.html
http://ss64.com/ps/foreach-object.html
http://ss64.com/ps/get-adgroupmember.html
http://ss64.com/ps/get-aduser.html
http://ss64.com/ps/select-object.html
http://ss64.com/ps/syntax-hash-tables.html
http://ss64.com/ps/new-object.html
http://ss64.com/ps/export-csv.html
Don't retire TechNet! -
(Don't give up yet - 13,085+ strong and growing) -
Comma delimited string relating to subreports
I previously opened a discussion called comma delimited string for a report header. The response I received then worked well for 'Year' but not for two other areas I am trying to use it for.
Original Code
Details:
whileprintingrecords;
stringvar Year:= Year+ {@Year} + ", ";
Report Footer:
whileprintingrecords;
stringvar Year;
Left(Year, len(Year)-2);
I needed to modify the code to eliminate duplication in Year and this worked fine. See the code below. I also needed this code for two other areas, Author and School. Without the extra line of code with the 'instr' function the code would always show and error for ' Left(author, len(author)-2);'. It came up with and error saying that the result was less than 0 or not and integer and went into debug mode. I added the instr function line and it worked for most but not all. This is my problem. Either the ' Left(author, len(author)-2);' line or 'If instr(author, {@Author } ) = 0 then' makes data disappear. It will show a comma delimited string for 'Author' on most rows but not from some. The same would be true for' School'. I am not sure what is going on. The code below is what I am currently using in the subreports.
Details:
whileprintingrecords;
stringvar author;
If instr(author, {@Author}) = 0 then
author:= author + {@Author } + ", ";
Report Footer:
whileprintingrecords;
stringvar author;
If instr(author, {@Author } ) = 0 then
author:= author + {@Author } + ", ";
Else
Left(author, len(author)-2);Hi Abhilash,
The code for the @Author is:
If ({Command.chrStatus} = "External")then
{Command.chrSurname} & ", " & {Command.chrFirstname}
Else
{Command.chrSurname(1)} & ", " & {Command.chrFirstname(1)}
The goal of this code was to pull all the authors into one comma delimited string.
eg Smith, Brian; Jones, Barry; Lee, Henry
The same desire was with the Schools and the code was the same. I just don't know why this is returning the blanks.
You mentioned in the last post that this would be better done in an SQL command. Should I open up another discussion because I think this would be the way to go. I just don't know how I can do the same comma delimited code in SQL.
Thanks -
Convert xls to comma delimited
hi all...
i have a xls file which needs to be converted to comma delimited dat file.
can somebody help me on this.
thnks,
i need it programatically pls!!Check the below program :
Upload xls file and you can see .txt file ( with comma delimted)
Input ( XLS file )
aaa 1245 2344 233 qwww
233 2222 qwww www www
Output ( .txt file with comma delimted)
aaa,1245,2344,233,qwww
233,2222,qwww,www,www
REPORT ZFII_MISSING_FILE_UPLOAD no standard page heading.
data : begin of i_text occurs 0,
text(1024) type c,
end of i_text.
Internal table for File data
data : begin of i_data occurs 0,
field1(10) type c,
field2(10) type c,
field3(10) type c,
field4(10) type c,
field5(10) type c,
end of i_data.
data : begin of i_download occurs 0,
text(1024) type c,
end of i_download.
data : v_lines type sy-index.
data : g_repid like sy-repid.
data v_file type string.
data: itab like alsmex_tabline occurs 0 with header line.
data : g_line like sy-index,
g_line1 like sy-index,
$v_start_col type i value '1',
$v_start_row type i value '1',
$v_end_col type i value '256',
$v_end_row type i value '65536',
gd_currentrow type i.
selection-screen : begin of block blk with frame title text.
parameters : p_file like rlgrap-filename obligatory.
selection-screen : end of block blk.
initialization.
g_repid = sy-repid.
at selection-screen on value-request for p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = g_repid
IMPORTING
FILE_NAME = p_file.
start-of-selection.
Uploading the data into Internal Table
perform upload_data.
download the file into comma delimted file.
perform download_data.
*& Form upload_data
text
--> p1 text
<-- p2 text
FORM upload_data.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = p_file
I_BEGIN_COL = $v_start_col
I_BEGIN_ROW = $v_start_row
I_END_COL = $v_end_col
I_END_ROW = $v_end_row
TABLES
INTERN = itab
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
write:/10 'File '.
ENDIF.
if sy-subrc eq 0.
read table itab index 1.
gd_currentrow = itab-row.
loop at itab.
if itab-row ne gd_currentrow.
append i_data.
clear i_data.
gd_currentrow = itab-row.
endif.
case itab-col.
when '0001'.
first Field
i_data-field1 = itab-value.
second field
when '0002'.
i_data-field2 = itab-value.
Third field
when '0003'.
i_data-field3 = itab-value.
fourth field
when '0004'.
i_data-field4 = itab-value.
fifth field
when '0005'.
i_data-field5 = itab-value.
endcase.
endloop.
endif.
append i_data.
ENDFORM. " upload_data
*& Form download_data
text
--> p1 text
<-- p2 text
FORM download_data.
loop at i_data.
concatenate i_data-field1 ',' i_data-field2 ',' i_data-field3 ','
i_data-field4 ',' i_data-field5 into i_download-text.
append i_download.
clear : i_download,
i_data.
endloop.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME =
'C:\Documents and Settings\smaramreddy\Desktop\fff.txt'
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = i_download
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " download_data
Thanks
Seshu -
hi,
I've a delimited report, which outputs into an ascii text file. When i open output file
in notepad it looks ok. But when i open it in excel it gives a blank row between two
data rows. Seems like it's appending a carriage return after each row. How can i get
away with this.
Same problem happens in another report, which i'm sending through e-mail. When i open
it in previewer it's fine but when i send it through e-mail it gives a blank row between two
data rows. I'm using MAPI to send the e-mail.
if possible please also reply at
[email protected]
thanks you
---himanshuHi,
One method I can suggest is to :
1. Spool the result to a file
2. Use the Unix shell to read the file [ The file will contain only 1 row, which is the result of your SQL ]
3. based on the value returned from SQL in the output spool file, you can decide on the next processing steps.
Here's a short example of SQL script and the Unix Shell :
----- Sql Script (a.sql) -----
Spool /usr/tmp/myfile;
select
count(1)
from from ud
where ud.country = 'CAN'
and ud.code NOT IN (select code from ud_update);
Spool off;
Exit;
-- The Shell Script ----
# call the SQL script
sqlplus userid/password@connectstring /usr/tmp/a.sql
res=`cat /usr/tmp/myfile.lst`;
if $res !=0 Then
run_another SQL script
elsif
echo "Return code is 0"
fi
-- Shailender Mehta -- -
DRM Function to divide comma delimited string to list value
Hi
Any one knows how to seperate comma delimited string into list values.
ThanksAre you wanting to dynamically set the list values for a property? If so there are a couple options:
1. You can update them via the API.
2. You can write a sql script to update the table Property_List. This requires an application server restart and generally isn't recommended for support reasons but it makes sense in some instances.
Edited by: Naren Truelove on 16/02/2011 22:08
Maybe you are looking for
-
Debugging a script and smart form
Hi Can u explain me How to Debug a Script and Smart from in Real time
-
Greyfield Deployment of UC320w with RV120w
I have a number of customers using the RV120w Small Business Firewall/Router in their business, and am having problems deploying the UC320w into these networks in a greyfield scenario. I am following the published Cisco document for configuring the u
-
Port Channels - WLC 5508 and 4510
LACP and PAgP are not supported on the controller and it appears that the 4500 series will not use LAG. interface Port-channel10 description WLC Port-Channel switchport switchport mode trunk service-policy input AutoQos-4.0-Input-Policy service-
-
ODI Procedure - updting the source table
Hi, I need to call a PL/SQL package via ODI. I used ODI procedure to do the task. In source tab - select empid from employee In target tab - decalre ab varchar2(25); begin pack1.proced1(:empid,ab); update success1 set val1 = ab where empid = *:empid;
-
Quicktime-How do I delete clips which have been downloaded
In the dock I have quicktime-lists items which haVE BEEN DOWNLOADED.HOW DO I DELETE ITEMS?