Telerik RadGrid export biff format is giving HTML content in columns - telerik-grid

I am using telerik ASP.NET AJAX UI control is one of my webform . I am using the format GridExcelExportFormat.Biff. I am getting problem that when I am exporting the file the generated excel file has html content in columns. How can I get rid of that content or best will be to make available the content as on page in file.

In BiffExporting event of grid, I resolved the issue by using below code:
e.ExportStructure.Tables(0).Cells(View.Columns.IndexOf(View.GetColumn("Revenue")) - _FirstColumnIndex, 1).Value =
e.ExportStructure.Tables(0).Cells(View.Columns.IndexOf(View.GetColumn("Revenue")) - _FirstColumnIndex, 1).Value.ToString().Replace("", String.Empty)

Related

How to achieve header, footer and pages features like MS-office document in tinyMCE/ckeditor?

My application users can import ms-office document (docx) content to the editor(tinyMCE/Ckeditor) or export the editor content to docx. So the problem is, Header and footer of docx will not behave as such.
Added i want docx pages functionality into the editor like page 1, page 2 and etc.,
I have tried with document editor functionality on Ckeditor - https://ckeditor.com/ckeditor-4/demo/#document, but it is not satisfying my expectation.
My application is with Angular 7 and Node JS.
can somebody give me alternate solution to achieve this kind of functionality.

How to export <table> content (which is inside a one <div >) into excel by JSP

I have developed a web application using JSP which creates a page with
several page elements and a with multiple records.
I wanted to export the content in that into an excel file.
I used the code
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "inline; filename="
+ "excel.xls");
as described in this article http://www.quicklyjava.com/export-web-page-to-excel/
But it exports the whole page.
How can a export only the content in that particular table?
I cannot use the Apache POI library since i have to format(text colors,cell colors) the content in the JSP. And i need the same formatting in the excel file.
Can somebody help me with this? :)
Haven't found a way to export only a single table in a page.
But the intended task(create a excel sheet with formatted data) can be done by Apache POI HSSF library
Here are the links to learn how to & examples -
http://poi.apache.org/spreadsheet/how-to.html#user_api
http://poi.apache.org/spreadsheet/examples.html

COGNOS generate report in xls format

I have one prompt page, one html report output page and one xls report output page. On prompt page, I have a prompt that selects Output Format(HTML/XLS) and a generate button that generates the report. The generate button needs to display the output page in the correct format.
The 'Generate' button just does promptAction('finish'). The thing is that no matter what i select in the format (XLS,PDF etc),promptAction('finish') always generates the HTML output.
So is there a way to call something like promptAction('finish', varFormat)?
I normally do this the other way around - use native Cognos functionality to run it in the format required (i.e. using run with options). Then use a variable to detect the format that was applied then apply conditional formatting. In your case the would be rendering the XLS page if XLS was selected and render the HTML page if HTML was selected.
I remember having this problem with HTML vs PDF page rendering. I don't have Cognos in front of me but what i found out is that i had to update my conditional style/format because the following would not work right... it was a strange problem but i did come up with a workaround
old pseudo code that wouldnt' work.
Created Variable that says
Case RENDER_TYPE
When PDF
THEN PDF
WHEN HTML
THEN HTML
End
then i put on a conditional style using this variable to make the page visible or not... and this would not work.
what i had to do was this...
Case
When RENDER TYPE = 'HTML'
Then 'HTML'
Else 'PDF' <- or in your case EXL
End
of course its only good for two formats but for some strange reason trying to use any other value than HTML created weird behavior.
Thanks,
If Render Type <> 'HTML' then render PDF otherwise render HTML...
i had problems anytime referring to the render variable with anything other than HTML. So basically i just had to test when HTML then HTML else other format.

Can I add a button to a CFGRID that lets a user export the grid to an XLSX file? How?

I'm a coldfusion developer working on a reporting application to display information from a CFSTOREDPROC process. I've been able to get the data from my query to display correctly in a CFGRID, and I'm really happy with the display of the data. The grid saves a lot of time because it avoids using the CFOUTPUT tag and formatting the data in HTML for hundreds of reports.
All I would like to do is add a simple Disk Icon somewhere on the datagrid control that would save the contents of the datagrid and export it into an XLSX(2010) file that an end user could then manipulate in a spreadsheet program. This is important because the data needs to have a 'snapshot' at certain times of year saved.
Solutions Tried:
I looked into having a link from the report options page that would fire into a report_xls.cfm page but designing a page that catches all of the report options a second time seems dumb and would add thousands of CFM's to the website.
CFSPREADSHEET seems not to work for a variety of reasons. One is that the server seems to constantly fight me with the 'write' function in this tag. Another is that I don't know how to make the javascript work for this button to get the output that I want.
I also looked into doing this as a Javascript button that would fire based on the data entered. Although the data from a CFSTOREDPROC will display correctly if I use a CFOUTPUT block, CFGRID seems to have a hard time with all output styles except HTML. This has caused some difficulty with these solutions because the application doesn't spit out a neat HTML table but instead sends a javascript page section.
Raymond Camden's blog contains an entry Exporting from CFGRID that we used in our project.
The example in the article exports to PDF, but it is rather simple to modify the download.cfm file to export to Excel files as well:
You modify the file to generate the <table>...</table> HTML from his example in a <cfsavecontent variable="exportList"> tag, so that the #exportList# variable contains the table that will be shown in the spreadsheet.
Next we have a URL parameter mode that determines whether it is exported to PDF or Excel.
So the end of our download.cfm looks like the following:
<cfif url.mode EQ "PDF">
<cfheader name="Content-Disposition" value="inline; filename=report.pdf">
<cfdocument format="pdf" orientation="landscape">
<cfoutput>#exportList#</cfoutput>
</cfdocument>
<cfelse>
<cfcontent type="application/vnd.ms-excel">
<cfheader name="Content-Disposition" value="report.xls">
<cfoutput>#exportList#</cfoutput>
</cfif>

How to change teamsite text layout programmatically?

I have a code that creates a teamsite. After that I add some web parts to wiki web part zone(rich content area). In SharePoint 2010 user can change a text layout of the rich content in page edit mode.
Is there any way to programmatically change the text layout of the rich text area? I would want to set "two columns with header"-layout after site creation has completed.
My site is created like this.
site = elevatedSite.SelfServiceCreateSite(params.....);
rootWeb = site.RootWeb;
rootWeb.ApplyWebTemplate("STS#0");
SPListItem currentItem = rootWeb.Item;
var xhtml = currentItem[SPBuiltInFieldId.WikiField] as string;
Now I can modify the xhtml string and save it back to the page. I have tried to change it so that it contains exatly the same html structure which have created by sharepoint itself, when changing the text layout. After that change, actually it is not recognized as "two columns with header"-layout in sharepoint. It is still default one-column layout. Is there anybody who knows is it possible to change the text layout of the rich text area programmatically?
I found answer from here http://donalconlon.wordpress.com/2010/05/04/sp2010-creating-a-wiki-page-using-the-om/. SharePoint stores the information about used layout to the hidden span-element in wiki page.
For example, this presents two column layout without the header or footer.
<span id="layoutsData" style="display: none">false,false,2</span>
first false = no header
second false = no footer
2 = two columns
I have been looking for some information on doing the same thing. I found this blog post that checks out the page, edits the content then publish and approves it.
SharePoint 2010 change page content data through Object Model / API – Console Application
If you need to modify pure HTML content, its better to use cutom IHttpHandler (wrapped in dll) and connect it to SharePoint via web.config. Is is also allowing to modify dynamic content like AJAX responses.

Resources