Export to Excel -leading 0's
I have to download data from internal table to Excel sheet.
In the internal table i have a field xxx- that is type numc10
I have a value for this field-000001234
Now when i export this to excel sheet, leading zeroes are removed and the output is-1234
How can i make sure that the output in excel is displayed as 0000001234.
This is very importnant for our project.
Thanks in advance.
Hi Narendra,
See the exact code for leading zero's in XL File.
REPORT ZTEST3 line-size 400.
Place holder to keep leading zero's
DATA : V_CHAR(1) TYPE C VALUE ''''.
Internal table for MAKT Table
data : begin of i_makt occurs 0,
matnr like makt-matnr,
maktx like makt-maktx,
end of i_makt.
Internal table for XL File
See Material number is 18 char but i am declaring here 20 char length
data : begin of i_file occurs 0,
matnr(20) type c,
maktx like makt-maktx,
end of i_file.
start-of-selection.
select matnr maktx from makt into table i_makt.
loop at i_makt.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = i_makt-matnr
IMPORTING
OUTPUT = i_makt-matnr
CONCATENATE V_CHAR i_makt-matnr INTO i_file-matnr.
i_file-maktx = i_makt-maktx.
append i_file.
clear i_file.
endloop.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = ' '
CODEPAGE = ' '
FILENAME =
'C:\Documents and Settings\smaramreddy\Desktop\fff.xls'
FILETYPE = 'ASC'
MODE = ' '
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
COL_SELECT = ' '
COL_SELECTMASK = ' '
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = i_file
FIELDNAMES =
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Please close thread.
Reward Points if it is helpful
Thanks
Seshu
Similar Messages
-
Export to Excel - leading zeros problem
Hello,
I wrote an application, which exports the data from an internal table into an excel file.
I defined a variable as char20. The variable contains the value '000256'.
When I generate the excel file, the leading zeros are cut and so only the value 256 is stored into the cell.
Is it possible to prevent the cut of the zeros?
Best regards & Thanks in advance
Here is a part of may code:
conv_out = cl_abap_conv_out_ce=>create( encoding = 'UTF-8' ).
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = gv_content
IMPORTING
buffer = gv_xtext.
attach the first file
conv_out->convert( exporting data = gv_xtext ).
cl_wd_runtime_services=>attach_file_to_response(
i_filename = 'file1.XLS'
i_content = gv_xtext
i_mime_type = 'application/msexcel'
i_in_new_window = abap_true
i_inplace = abap_true ).you could add an apostrophe ' in front of all fields that you want exported as a text.
this will ensure no truncating is done.
it's excel that does the shifting, so you can't really interfere from the SAP side -
JHS: Export to Excel doesn't work when having leading zeros
Oracle JHeadstart Release 11.1.1.2.29
We are using the Export to excel option, but when we have leading zeros it doesn't export it as text so the data is incorrect.
Can any one please tell how doe we configure JHeadstart/ADF to have the leading zeros and export it as text rather than as number.
Regards
RamRam,
Export to excel is native ADF feature,not related to JHeadstart. Please post your question on the JDeveloper forum.
Steven davelaar,
JHeadstart team. -
Export to Excel - data with leading zeros
Does anyone have any tips or tricks for running a query then exporting to Excel without dropping leading zeros from the data?
Examples: numeric Item codes with leading zeros, telephone numbers that have been entered with no spaces.
Regards,
Douglas McDove< Font Color="RED" Size = 3 Face=Verdana>
I liked the challenge and therefore.......I got this for you
</Font>
SELECT CHAR(28) + T0.CardCode [BP Code\] FROM [dbo\].[OCRD\] T0
SELECT CHAR(29) + T0.CardCode [BP Code\] FROM [dbo\].[OCRD\] T0
SELECT CHAR(30) + T0.CardCode [BP Code\] FROM [dbo\].[OCRD\] T0
SELECT CHAR(31) + T0.CardCode [BP Code\] FROM [dbo\].[OCRD\] T0
Any of the above 4 should work. T0.CardCode is the database field I tested, you can substitute this with any database field and it should work.
Regards
Suda -
Export to Excel, VARCHAR2 DB Type and leading zeros issue
Oracle JHeadstart Release 11.1.1.2.29
We are using the Export to excel option, but when we have leading zeros it doesn't export it as text so the data is incorrect.
Can any one please tell how doe we configure ADF to have the leading zeros and export it as text rather than as number.
<af:commandMenuItem partialSubmit="true"
textAndAccessKey="#{nls['EXPORT']}"
icon="/jheadstart/images/excel.png"
immediate="true" id="cmi0">
<af:exportCollectionActionListener exportedId="IdLookupTab"
type="excelHTML"/>
</af:commandMenuItem>
Regards
Ramyou could add an apostrophe ' in front of all fields that you want exported as a text.
this will ensure no truncating is done.
it's excel that does the shifting, so you can't really interfere from the SAP side -
Timeout when using ALV build-in functionality: exporting to Excel
Hello,
I have the following problem within one of my web dynpro abap applications:
I need to be able to display data in a table that preferably should be via alv component.
Then I shall also be able to download the displayed data via Excel.
So I have embedded the ALV component I added to the component within a view and activated the export to excel button.
Downloading small amount of data does no lead to any problem, but when trying to process a larger amount of data (in this case 22500 entries), I get a timeout.
Does anybody have any idea if it is possible to increase performance here without reducing the amount of data to be downloaded?
thanks a lot ion advance!
AnaHello,
coming back to the UI element download.
I managed to get the data being saved to the desktop, but unfortunately, the data remains being displayed as in chines letters.
Anybody got an idea, what parameters I might have set wrong? Or if I have to do an additional encoding before generating the XString?
Here is the supply method code and the parameters I have set in the UI element:
The Supply method
method GEN_EXCEL_DOWNLOAD_DATA .
data: wa_cmx_line type zksb_cmxshowline.
data: lt_excel type zksb_cmx_excel_download_t.
data: wa_excel type zksb_cmx_excel_download.
data: l_guid type guid_32.
data: l_url type string.
* read context-------------------------------------------------------------------------------------
data lo_nd_z_ksb_get_prcm type ref to if_wd_context_node.
data lo_nd_exporting type ref to if_wd_context_node.
data lo_nd_rt_zksb_cmx_show type ref to if_wd_context_node.
data lo_el_rt_zksb_cmx_show type ref to if_wd_context_element.
data lt_rt_zksb_cmx_show type table of wd_this->element_rt_zksb_cmx_show.
data wa_rt_zksb_cmx_show like line of lt_rt_zksb_cmx_show.
* navigate from <CONTEXT> to <Z_KSB_GET_PRCM> via lead selection
lo_nd_z_ksb_get_prcm = wd_context->get_child_node( name = wd_this->wdctx_z_ksb_get_prcm ).
* navigate from <Z_KSB_GET_PRCM> to <EXPORTING> via lead selection
lo_nd_exporting = lo_nd_z_ksb_get_prcm->get_child_node( name = wd_this->wdctx_exporting ).
* navigate from <EXPORTING> to <RT_ZKSB_CMX_SHOW> via lead selection
lo_nd_rt_zksb_cmx_show = lo_nd_exporting->get_child_node( name = wd_this->wdctx_rt_zksb_cmx_show ).
* @TODO handle not set lead selection
if lo_nd_rt_zksb_cmx_show is initial.
endif.
* get static attributes table
lo_nd_rt_zksb_cmx_show->get_static_attributes_table( importing table = lt_rt_zksb_cmx_show ).
* reduce data to only the data that shall be displayed----------------------------------------
loop at lt_rt_zksb_cmx_show into wa_rt_zksb_cmx_show.
move-corresponding wa_rt_zksb_cmx_show to wa_excel.
append wa_excel to lt_excel.
endloop.
* populate data as tab separated strings-----------------------------------------------------
data l_str type string.
data lv_struct type extdfiest.
data itab type ref to zksb_cmx_excel_download_t.
data r_xstring type xstring.
data s(256) type c.
field-symbols <wa_desc> like line of lv_struct.
field-symbols: <tab> type table.
field-symbols: <wa> type any.
field-symbols: <f> type any.
* populate the column headers----------------------
get reference of lt_excel into itab.
* assign lt_excel to <tab>.
assign itab->* to <tab>.
lv_struct = wd_this->get_table_structure( itab = itab ).
loop at lv_struct assigning <wa_desc>.
concatenate wa_cmx_line
<wa_desc>-coltitle
cl_abap_char_utilities=>horizontal_tab
into wa_cmx_line.
endloop.
concatenate wa_cmx_line
cl_abap_char_utilities=>cr_lf
into wa_cmx_line.
* loop through the data table-----------------------
loop at <tab> assigning <wa>.
loop at lv_struct assigning <wa_desc>.
assign component sy-tabix of structure <wa> to <f>.
check sy-subrc = 0.
if <wa_desc> is assigned and <wa_desc>-convexit is not initial.
* Process any output conversion routines
concatenate 'CONVERSION_EXIT_' <wa_desc>-convexit '_OUTPUT' into wa_cmx_line.
call function wa_cmx_line
exporting
input = <f>
importing
output = s.
else.
concatenate wa_cmx_line
<f>
cl_abap_char_utilities=>horizontal_tab
into wa_cmx_line.
endif.
endloop.
concatenate wa_cmx_line
cl_abap_char_utilities=>cr_lf
into wa_cmx_line.
endloop.
*Convert the strings to Binary strings (UTF-16le)------------------------------------------------
call function 'SCMS_STRING_TO_XSTRING'
exporting
text = wa_cmx_line
mimetype = ''
importing
buffer = r_xstring.
*Add the UTF-16 Little Endian Byte Order Mark to the begining of the file
concatenate cl_abap_char_utilities=>byte_order_mark_little
r_xstring
into r_xstring in byte mode.
* set context
DATA lo_nd_excel_download TYPE REF TO if_wd_context_node.
DATA lo_el_excel_download TYPE REF TO if_wd_context_element.
DATA ls_excel_download TYPE wd_this->element_excel_download.
DATA lv_excel_download_data LIKE ls_excel_download-excel_download_data.
* navigate from <CONTEXT> to <EXCEL_DOWNLOAD> via lead selection
lo_nd_excel_download = wd_context->get_child_node( name = wd_this->wdctx_excel_download ).
* get element via lead selection
lo_el_excel_download = lo_nd_excel_download->get_element( ).
* set single attribute
lo_el_excel_download->set_attribute( name = `EXCEL_DOWNLOAD_DATA` value = r_xstring ).
endmethod.
and the parameters to the UI are as follows
behaviour: allowSave
data: <data that was created by supply method>
fileName: CMX.xls also tried CMX.cvs
mime-type: ms-excel also tried /vnd.ms-excel
text: $OTR:SOTR_VOCABULARY_BASIC/DOWNLOAD
textDirection: inherit
type: navigation
visible: Visible
Any suggestion of what I might have to change would be great!
Tx
Ana -
ALV TO EXCEL PROBLEM? ( 90 COLUMNS ALV CAN'T EXPORT TO EXCEL NORMALLY)
HI ABAPERS,
anyone have a alv that have over 90 columns and want to export to excel have experienced abnormal formating (like the header row show only up to 60 column and the rest show up in next row) and the data show in separate line.
anyway can have a better format?
also after 90 columns show up on alv, it can't show anymore except modify the layout in run time.
can we do something before that?
thanks & regards,
HOWARDHi HOWARD,
My Report ouput having more than 90 columns in ALV, while downloading data from ALV to Excel sheet am facing alignment problem. (ie) the output column > 66 are appearing in next line of the excel sheet leads to improper alignment.
Pls give me a solution as u had already come across this issue..
Thank & Regards,
Paramesh. -
#NAME shows in export to excel
When an export to excel is done in a report some colunms display #NAME. These columns have a '-','*' , etc. as the leading character. Is there a way to have the correct data in the excel report?
Thanksthe 'old fashioned way' is to add a single quote ( ' ) add the start of the string. Excel recognizes this as "this entry is text only" and will not display it.
-
Character drops zeros when exported to Excel
I have a template that when exported to Excel from E-Business Suite, drops the leading zeros. We want those zeros to be there.
For example, Project Number 000400 is SEGMENT1 of PA_PROJECTS_ALL so when viewed in Word, it shows the full text string. When the user exports to Excel, it drops the three leading zeros and just displays 400.
Is there a way around this?
Thanks,
RobUse a special character called a non-breaking-space and that should resolve your issue. Put it before or after your xml field
Insert->Symbol->Special Characters Tab->Nonbreaking Space
or
Ctrl+Shift+SpaceIf this works, don't forget to give me some points. :-)
Ike Wiggins
http://bipublisher.blogspot.com -
Export to Excel - Problem with extra rows
Hi have a report that has 3 groups. I suppress the group headers and am using the group footers for totals.
When I export to excel, I get extra rows in the excel file for the suppressed sections. How can I get rid of these?
Thanks,
LindaI can use this to get out additional rows on my excel export. However, in the columns, I usually put some distance between each column so the columns won't run together. This is giving me extra columns. It would be much easier if I did not have to put that distance. Is there a way to format the field to have a leading or trailing space so all the fields don't run together on the report?
example:
field1
field2
field 3
if all these fields have data the output would look like:
field1datafield2datafield3data
how can I make it look like:
field1data field2data field3data -
Crystal Report:Export to Excel in multiple sheets
Hi Members,
Does any one know how to export Crystal Report to Excel in multiple sheets in the same Excel workbook.
Suppose I have report grouped by Designation as Managers,Tech Leads,Team Leads,Senior Developers etc. Now I want to export to Excel in multiple sheets as Sheet1-Managers,Sheet2-Tech Leads,-Sheet3-Team Leads,Sheet4-Senior Developers etc.
Is there any possibility in Crystal Report event or CrystReportViewer?
If not then is then workaround to achieve this feature without using Excel COM object.
Thanks & Regards
NitinDon't forget to search for your answer before posting:
[KBase|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_ossnotes&query=&adv=true]
[Articles|https://www.sdn.sap.com/irj/sdn/businessobjects-articles]
These forums.
Also, see the search box at the top right of this page. It searches articles, notes, forums, wikis and blogs in one shot. A quick search for; excel export worksheet crystal, came up with the following:
[1260151 - CR XI R2 Export to multiple Excel worksheets|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
[1216567 - Is it possible to export one report to multiple Excel worksheets?|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]
Also, remember that if you can not do "it" in the CR designer, you more than likely can not do it at runtime.
Ludek
Follow us on Twitter http://twitter.com/SAPCRNetSup -
I'm working on a quote report which has narrative sections as well as a table. I can get the report to look great in the application but it has formatting problems once exported to excel.
In one of my narrative reports I have a simple table with a few columns. Once exported to excel the first narrative column is the entire width of the report table below it. The large cell row is also merged cells in excel.
Is there anything that can be done to help force how the report goes into excel?
I have also tried creating the report in a narrative html table to export into excel.Can someone explain if they face similar issues as I am when you export a report output on portal to Excel it takes huge size. I assume it because of all the color formatting etc. but is there a way to reduce this size. 3.5 Bex Analyzer same report takes only 3 MB while if I export it from portals it takes 32 MB.
-
After Export to Excel File error while opening using xmlwriter in silverlight
Can one help me in fixing following issue after to export to excel had done iam getting following error message
"The file you are trying to open, 'test.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do uou want to open the file now ?"
If i click Yes file opens correctly but it shows above message . Can any one suggest me how to avoid this programatically with the following code.
I tried by changing the file saving as .xls to .xlsx but it doesnt works.
Public Sub Export()
Dim ss As String = "urn:schemas-microsoft-com:office:spreadsheet"
Dim DataType As String
Dim DataValue As Object
'Dim DataView As C1.Silverlight.Data.DataView = m_DataGrid.ItemsSource
'Dim ItemsSource As C1.Silverlight.Data.DataTable = DataView.Table
Dim XmlSettings As XmlWriterSettings
Dim ColumnBinding As Binding
Dim FieldName As String
Dim DataGridColumn As C1.Silverlight.DataGrid.DataGridColumn
Dim ColumnIndex As Integer
Dim J As Integer
Dim DataGridRow As C1.Silverlight.DataGrid.DataGridRow
Dim CommonUtil As New GoldCRM.Core.Common.Util
Dim PropertyInfo As System.Reflection.PropertyInfo
Dim CellFormat As String
Try
If m_DataGrid.Rows.Count = 0 Then Exit Try
XmlSettings = New XmlWriterSettings
XmlSettings.Indent = True
XmlSettings.NewLineOnAttributes = False
Using myXML As XmlWriter = XmlWriter.Create(m_Stream, XmlSettings)
With myXML
.WriteStartDocument()
.WriteProcessingInstruction("mso-application", "progid=" & ControlChars.Quote & "Excel.Sheet" & ControlChars.Quote)
.WriteStartElement("Workbook", ss)
.WriteStartElement("DocumentProperties", "urn:schemas-microsoft-com:office:office")
.WriteElementString("Author", m_DocumentProperties.Author)
.WriteElementString("LastAuthor", String.Format("{0} {1}", Application.Current.Resources("EmpFirstName"), Application.Current.Resources("EmpLastName")))
.WriteElementString("Created", m_DocumentProperties.Created)
.WriteElementString("LastSaved", m_DocumentProperties.LastSaved)
.WriteElementString("Company", Application.Current.Resources("REPORTINGSITENAME"))
.WriteElementString("Version", m_DocumentProperties.Version)
.WriteEndElement() 'Document Properties
.WriteStartElement("ExcelWorkbook", "urn:schemas-microsoft-com:office:excel")
.WriteElementString("WindowHeight", m_WorkbookProperties.WindowHeight)
.WriteElementString("WindowWidth", m_WorkbookProperties.WindowWidth)
.WriteElementString("WindowTopX", m_WorkbookProperties.WindowTopX)
.WriteElementString("WindowTopY", m_WorkbookProperties.WindowTopY)
.WriteElementString("ProtectStructure", m_WorkbookProperties.ProtectStructure)
.WriteElementString("ProtectWindows", m_WorkbookProperties.ProtectWindows)
.WriteEndElement() 'Excel Workbook
.WriteStartElement("Styles")
For I As Integer = 0 To m_Styles.Count - 1
.WriteStartElement("Style")
.WriteAttributeString("ss", "ID", ss, m_Styles(I).ID)
If m_Styles(I).Name <> "" Then
.WriteAttributeString("ss", "Name", ss, m_Styles(I).Name)
End If
'ALIGNMENT LOGIC:
.WriteStartElement("Alignment")
If Not m_Styles(I).Alignment Is Nothing Then
If m_Styles(I).Alignment.Horizontal <> 0 Then
.WriteAttributeString("ss", "Horizontal", ss, m_Styles(I).Alignment.Horizontal.ToString)
End If
If m_Styles(I).Alignment.Vertical <> 0 Then
.WriteAttributeString("ss", "Vertical", ss, m_Styles(I).Alignment.Vertical.ToString)
End If
If m_Styles(I).Alignment.WrapText = True Then
.WriteAttributeString("ss", "WrapText", ss, "1")
End If
End If
.WriteEndElement()
'BORDER LOGIC:
.WriteStartElement("Borders")
.WriteStartElement("Border")
.WriteAttributeString("ss", "Position", ss, "Bottom")
.WriteAttributeString("ss", "LineStyle", ss, "Continuous")
.WriteAttributeString("ss", "Weight", ss, "1")
.WriteEndElement() 'Border
.WriteStartElement("Border")
.WriteAttributeString("ss", "Position", ss, "Left")
.WriteAttributeString("ss", "LineStyle", ss, "Continuous")
.WriteAttributeString("ss", "Weight", ss, "1")
.WriteEndElement() 'Border
.WriteStartElement("Border")
.WriteAttributeString("ss", "Position", ss, "Right")
.WriteAttributeString("ss", "LineStyle", ss, "Continuous")
.WriteAttributeString("ss", "Weight", ss, "1")
.WriteEndElement() 'Border
.WriteStartElement("Border")
.WriteAttributeString("ss", "Position", ss, "Top")
.WriteAttributeString("ss", "LineStyle", ss, "Continuous")
.WriteAttributeString("ss", "Weight", ss, "1")
.WriteEndElement() 'Border
.WriteEndElement() 'Borders
'FONT LOGIC:
.WriteStartElement("Font")
Dim myFont As Excel.Styles.Font = m_Styles(I).Font
.WriteAttributeString("ss", "FontName", ss, myFont.FontName.ToString)
.WriteAttributeString("ss", "Size", ss, myFont.Size)
.WriteAttributeString("ss", "Color", ss, myFont.Color.ToString.Remove(1, 2))
If myFont.Bold = True Then .WriteAttributeString("ss", "Bold", ss, "1")
If myFont.Italic = True Then .WriteAttributeString("ss", "Italic", ss, "1")
If myFont.Underline <> 0 Then .WriteAttributeString("ss", "Underline", ss, myFont.Underline.ToString)
.WriteEndElement()
Dim myInterior As Excel.Styles.Interior = m_Styles(I).Interior
.WriteStartElement("Interior")
.WriteAttributeString("ss", "Color", ss, myInterior.Color.ToString.Remove(1, 2))
.WriteAttributeString("ss", "Pattern", ss, "Solid")
.WriteEndElement()
.WriteStartElement("NumberFormat")
.WriteEndElement()
.WriteStartElement("Protection")
.WriteEndElement()
.WriteEndElement() 'Style
Next I
.WriteStartElement("Style")
.WriteAttributeString("ss", "ID", ss, "DateStyle")
.WriteStartElement("NumberFormat")
.WriteAttributeString("ss", "Format", ss, "General Date")
.WriteEndElement() 'NumberFormat
.WriteEndElement() 'Style
.WriteStartElement("Style")
.WriteAttributeString("ss", "ID", ss, "HeaderStyle")
.WriteStartElement("Font")
.WriteAttributeString("x", "Family", ss, "Swiss")
.WriteAttributeString("ss", "Bold", ss, "1")
.WriteEndElement() 'Font
.WriteEndElement() 'Style
.WriteEndElement() 'Styles
'WORKSHEETS:
.WriteStartElement("Worksheet")
.WriteAttributeString("ss", "Name", ss, "WORKSHEET")
.WriteStartElement("Table")
.WriteAttributeString("ss", "ExpandedColumnCount", ss, m_DataGrid.Columns.Count)
.WriteAttributeString("ss", "ExpandedRowCount", ss, m_DataGrid.Rows.Count + 100) 'Temporary fix: sometimes 1 row is not added.
.WriteAttributeString("ss", "FullColumns", ss, m_DataGrid.Columns.Count)
.WriteAttributeString("ss", "FullRows", ss, m_DataGrid.Rows.Count + 100) 'Temporary fix: sometimes 1 row is not added.
.WriteAttributeString("ss", "DefaultRowHeight", ss, 15)
For Each DataGridColumn In m_DataGrid.Columns
If DataGridColumn.Visibility = Visibility.Visible Then
.WriteStartElement("Column")
If TypeOf DataGridColumn Is C1.Silverlight.DataGrid.DataGridNumericColumn Then
.WriteAttributeString("ss", "AutoFitWidth", ss, 1)
ElseIf TypeOf DataGridColumn Is C1.Silverlight.DataGrid.DataGridDateTimeColumn Then
.WriteAttributeString("ss", "AutoFitWidth", ss, 1)
Else
.WriteAttributeString("ss", "AutoFitWidth", ss, 0)
End If
If DataGridColumn.Width.Value <= 100 Then
.WriteAttributeString("ss", "Width", ss, 100)
Else
.WriteAttributeString("ss", "Width", ss, DataGridColumn.Width.Value)
End If
.WriteEndElement()
End If
Next
J = 0
For Each DataGridRow In m_DataGrid.Rows
J += 1
If TypeOf DataGridRow Is GoldCRM.Controls.Filter.clsFilterRow Then
.WriteStartElement("Row")
.WriteAttributeString("ss", "Index", ss, J)
.WriteAttributeString("ss", "AutoFitHeight", ss, 0)
.WriteAttributeString("ss", "Height", ss, 15)
ColumnIndex = 0
For Each DataGridColumn In m_DataGrid.Columns
If DataGridColumn.Visibility = Visibility.Visible Then
FieldName = String.Empty
If TypeOf DataGridColumn Is DataGridBoundColumn Then
ColumnBinding = TryCast(DataGridColumn, DataGridBoundColumn).Binding
If ColumnBinding.Path IsNot Nothing Then
FieldName = ColumnBinding.Path.Path
End If
ElseIf TypeOf DataGridColumn Is DataGridTemplateColumn Then
If DataGridColumn.FilterMemberPath IsNot Nothing Then
FieldName = DataGridColumn.FilterMemberPath.Trim
End If
End If
If Not FieldName.Equals(String.Empty) Then
ColumnIndex += 1
.WriteStartElement("Cell")
.WriteAttributeString("ss", "Index", ss, ColumnIndex)
.WriteAttributeString("ss", "MergeAcross", ss, 0)
.WriteAttributeString("ss", "StyleID", ss, "HeaderStyle")
.WriteStartElement("Data")
.WriteAttributeString("ss", "Type", ss, "String")
If DataGridColumn.Header IsNot Nothing Then
.WriteValue(DataGridColumn.Header.ToString)
Else
.WriteValue("")
End If
.WriteEndElement() 'Data
.WriteEndElement() 'Cell
End If
End If
Next
.WriteEndElement() 'Row
End If
If Not (TypeOf DataGridRow Is GoldCRM.Controls.Filter.clsFilterRow) Then
.WriteStartElement("Row")
.WriteAttributeString("ss", "Index", ss, J + 1)
.WriteAttributeString("ss", "AutoFitHeight", ss, 0)
.WriteAttributeString("ss", "Height", ss, 15)
ColumnIndex = 0
For Each DataGridColumn In m_DataGrid.Columns
If DataGridColumn.Visibility = Visibility.Visible Then
FieldName = String.Empty
If TypeOf DataGridColumn Is DataGridBoundColumn Then
ColumnBinding = TryCast(DataGridColumn, DataGridBoundColumn).Binding
If ColumnBinding.Path IsNot Nothing Then
FieldName = ColumnBinding.Path.Path
End If
ElseIf TypeOf DataGridColumn Is DataGridTemplateColumn Then
If DataGridColumn.FilterMemberPath IsNot Nothing Then
FieldName = DataGridColumn.FilterMemberPath.Trim
End If
End If
If Not FieldName.Equals(String.Empty) Then
ColumnIndex += 1
Dim DataCellValue As Object = Nothing
If Not (TypeOf DataGridRow Is GoldCRM.Controls.Filter.clsFilterRow) Then
PropertyInfo = CommonUtil.GetProperty(DataGridRow.DataItem, FieldName)
If PropertyInfo IsNot Nothing Then
DataCellValue = PropertyInfo.GetValue(DataGridRow.DataItem, Nothing)
End If
End If
CellFormat = String.Empty
If DataCellValue IsNot Nothing Then
Select Case DataCellValue.GetType.Name.ToUpper
Case "BitmapImage".ToUpper
DataValue = "Image"
DataType = "String"
Case "Hyperlink".ToUpper
DataType = "String"
DataValue = "Hyperlink"
Case "Decimal".ToUpper
DataType = "Number"
DataValue = DataCellValue
Case "DateTime".ToUpper
If CType(DataCellValue, Date).Year > 1900 Then
DataType = "DateTime"
DataValue = DataCellValue
CellFormat = "DateStyle"
Else
DataType = "String"
DataValue = DataCellValue
End If
Case Else
DataType = "String"
DataValue = DataCellValue
End Select
Else
DataType = "String"
DataValue = String.Empty
End If
.WriteStartElement("Cell")
.WriteAttributeString("ss", "Index", ss, ColumnIndex)
.WriteAttributeString("ss", "MergeAcross", ss, 0)
If Not CellFormat.Equals(String.Empty) Then
.WriteAttributeString("ss", "StyleID", ss, CellFormat)
End If
.WriteStartElement("Data")
.WriteAttributeString("ss", "Type", ss, DataType)
.WriteValue(DataValue)
.WriteEndElement() 'Data
.WriteEndElement() 'Cell
End If
End If
Next
.WriteEndElement() 'Row
End If
Next
.WriteEndElement() 'Table
.WriteEndElement() 'Worksheet
.WriteEndElement() 'Workbook
.WriteEndDocument()
.Close()
End With
End Using
Catch ex As Exception
Throw New Exception(ex.Message, ex)
Finally
If m_Stream IsNot Nothing Then
m_Stream.Close()
m_Stream.Dispose()
End If
m_Stream = Nothing
m_DataGrid.IsLoading = False
DataValue = Nothing
'DataView = Nothing
'ItemsSource = Nothing
XmlSettings = Nothing
ColumnBinding = Nothing
DataGridColumn = Nothing
End Try
End Sub
KrishnaHi,
i have the same issue now where i need to populate the xport file name as report name. can you send me your solution please. -
Export to Excel Action in MS SSRS Report not exporting all data in Report
Hi,
I have developed a complex Report that has many expandable nodes in a table format. The report works fine.
However, when I export the Report to Excel using Actions --> export to Excel, only the data in expanded nodes is included. The data in collapsed nodes is not included.
I am looking for approach to include data in expanded nodes in Excel Export. The expanded data can be expanded in Excel.
Any help in this regard will be appreciated.Hi Abhijit PS,
Per my understanding you are experiencing the issue with the excel report which have add the drill down action, after export to excel only the expanded nodes included and the collapsed nodes is not shown, right?
Generally, if we expand the nodes before export to excel then the excel will display the expanded details row and keep collapsed the details row which haven't expand, but we have the toggle "+","-" on the left of the Excel to help
control the expand and collapse, when you click the "+" you can expand the collapsed notes to see the details rows.
I have tested on my local environment with different version of SSRS and can always see the "+","-" as below:
On the Top left corner you can find the "1","2", this help to control the "Collapse All" and "Expand All".
If you can't see the "+","-" in the excel, the issue can be caused by the Excel version you are currently using, and also excel have limit support of this, please provide us the Excel version information and the SSRS version. You
can reference to this similar thread:
lost collapsing columns when export to excel
Please try to export other drill down report to excel and check if they work fine, if they did, the issue can be caused by the drill down action you have added in this report is not correctly, if possible, please try to redesign the report.
Article below about how to add Expand/Collapse Action to an Item for your reference:
http://msdn.microsoft.com/en-us/library/dd220405.aspx
If your problem still exists, please feel free to ask
Regards
Vicky Liu -
Exporting to Excel from Aria People Search
Is it possible to export to Excel from Aria People Search.
I would like to output the Org Chart (built in) and the Tree (I created) to an Excel file.
Does anyone know how to do this?
Thanks,
TomHi,
If you are using 10g, then OLE2 is supported. However, it will be executed in the App Server Machine.
If you want to do the operation in the Client machine (as how it was done in the Client / Server), you need to use Client_OLE (Which is part of WebUtil).
Look at
http://www.oracle.com/technology/products/forms/htdocs/webutil/webutil.htm
for more details on WebUtil.
HTH.
Regards,
Arun
Maybe you are looking for
-
How to use enviroment variables in JSP code?
I�m developing a web server with JSP�s, and I need to move the application to others computers. I need to access to a directory, but I don�t know it because the user can install the Application in the directory he wants. So I need to access to that d
-
Getting error 51 saying 'IDoc included in IDoc packet containing an error'
When I am processing idoc in LSMW, getting error saying 'IDoc included in IDoc packet containing an error'. Can any one tell me how to resolve this.
-
Hi @all! I´m really looking for help! I try to design a schedule an have some problems doing this. Here the problem goes: Schedule looks like this (in a simplified form): Name ___________________ Street ___________________ City
-
How to use Tweens in FlashDevelop?
Ive got this text that needs to move from top to bottom and ive tried using the general x,y coordinates, however my teacher suggested to use tweens in starling. Ive searched the web and i keep finding 3rd party or custom made tweens. However does any
-
Why are iPads so expensive on Ebay?
I am interested in buying one of these devices, but I just don't have the money to buy a new one at this moment. I don't understand why it is impossible to find one for under $500, yet that is what the 16 GB Wi-Fi version costs from Apple. I understa