SQL 2008 R2 SSRS export to Excel - sql

I have a SSRS report that works fine but has an issue exporting to Excel or CSV formats.
I tried exporting to excel but errors out saying it has more than 256 columns.
So I was hoping I could just export it to CSV format. But with CSV I noticed that it adds up unwanted 'textbox1', textbox2 etc and also does not display the header that I actually added. Instead it would display the actual field name as header. I figured I could edit the individual properties to show Header Names. But the textboxes in the exported sheet is still an issue.
On the other hand I was trying if I could export it to excel but limit 100 columns per sheet or rest of the columns after 256 to next sheet that would be great.
I saw few posts on google breaking by group. But in my case I do not have columns to be grouped. Only need to break first 100 columns to sheet1 and next 100 to sheet2 or the 256 columns to sheet1 and the rest to next sheet.
No luck in both ways. Could you please help with this?
Error: "Excel Rendering Extension: Number of columns exceeds the
maximum possible columns per sheet in this format; Columns Requested:
264, Max Columns: 256"

This is a very common issue when you work with SSRS 2008 R2. If your reports have columns more than 256, then it doesn't export to Excel.
Try to understand this technically. Technicality is, SSRS reports by default install 2003 office component on Report server. When your report give a call to export data into excel, then report server internally give a call to office component. And if you will see, then you will find that in office 2003, you have maximum of 256 columns in a sheet. So in any case, you cannot export more than that using your existing infrastructure.
Options:
Move to SSRS 2012 or SSRS 2014. This will also update your office component to 2007 or 2010 where you can export up to 16,384 columns.
If you cannot move to new infrastructure then you have to break-down your reports such that it never exceeds to 256 columns.
Export to other formats like PDF. But when you do so, then it disturbs the UI. So I don't see this as a very feasible solution.

Related

Use an Excel Cell as a Input Data for filtration to a SQL Server View

I have a basic view in SQL Server which includes these columns,
"Lot Number" , "Time" , "Code" , "Name" , "Barcode"
Now I need a Excel file which will have EXACTLY the same columns and the same information.
What I want to do is, in the Excel file when I write a number to "lot number" section, the other columns will fill itself automatically based on the SQL Server view. Basically I'll be using "lot number" cell as a filtering.
The problem is that, this is a ERP system database. I don't want to extract all the information to Excel file, there are millions of rows. Excel should be blank, I will write the lot number first, then refresh the Excel file and the other columns should be filled in automatically. I will refresh the Excel every 1 min automatically and only 1 row is enough.
So I need a procedure in SQL Server (or in Excel) to receive data from the Excel cell, then use that data for filtration in a view and return the data to the same Excel.
Now I'll show you my set up, waiting for your ideas.
This Screen shot is the SQL Server view in "192.168.2.100" server. My SQL knowledge is pretty basic, I create views by schematics not by codes.
And this is the Excel file that I connected. As you can see I can extract all the data. (I deleted code-name-barcode cells. they are not empty, because these are official information).
Obviously this is not I want. When I put the lot number I want other data to came automatically. At least when I refresh the Excel file. Excel is in "192.168.2.116\\barkod\\Tyvek_Mdr.xls" . It is in a shared network.
So I have been researching but still I couldn't find the best solution. If someone can help me I'd really appreciate it.

SSIS Excel Destination doesn't works

One SSIS package does the data export from 3 sources to Excel. Before exporting into excel the file, the data goes through sorting, aggregation and finally it goes before Conditional Split. I placed data viewers at every place and could see that the records are there but when the excel is exported i don't see any records.
before the export happens, previous day excel is deleted and a new excel is created from a template excel. At the end of data flow task, I see excel containing columns from template excel and no rows in it.
What is causing this issue. I have kept data viewer and I see the data as it goes by but I don't see data after the conditional split or before the conditional split happens.
Please see the pic. After the conditional split, there are 3 excel destination. One of them which you can see.

sorting BIG excel data

Right so, I have been given a LOT of "consumer data" to sort, 3 excel files, each containing multiple worksheets, up to 7 worksheets, each up to 1M rows (max worksheet size in excel 2013 is just over 1 rows)
I need to pull out of these all people within a region, so have a list of post codes in this region (say 30 post code areas)
How can I achieve this most easily?
If the data was in SQL server, i'd just write a long SQL statement selecting all where postcode LIKE 'B75'% OR 'B74'% etc etc.
But in excel I can only run a "filer" on one worksheet at a time... (I think)
Is it going to be easiest to throw all the data into sql server, or have I overlooked a method?
First solution is to let Excel do the task of sorting for you. You need to add filters to columns and select Sorting options.
Other solution is to Export Data to SQL Table(s). To do this, Open SQL Management Studio, Right Click on Database to which you want to export data to and Select "From Excel File". Do this for each Excel file you have. After importing all data in Database, sort Data using SQL Query.
Second Solution is reliable but first solution is faster. You need to decide which one you should select.

SSRS Excel Exporting Error

I have Created SSRS Report with 25 Columns and when i run Report it fetch around 15000+ records but when i Export the Report in Excel Format it gives Error on Report Server and Local machine .i.e. "The Communication Object, System.ServiceModel.Channels.ClientFramingDuplexSessionChannel, cannot be Used for Communication Because it is in the Faulted State" it takes 3 minutes to execute Query in SQL 2008 R2 (SQL Server i am using) and 5 min to show on Report. What could be the problem? Thanks
i found some problem with my last Column i.e. Comments which contains more text (in some case's it's more than 36000 characters) so it works perfectly without the column Comments but still not sure about the Problem.
these kind of problems occur most of the time because of limitations of excell itself.
please check the following maximum limits:
Worksheet size - 1,048,576 rows by 16,384 columns
Column width - 255 characters
Row height - 409 points
Page breaks-1,026 horizontal and vertical
Total number of characters that a cell can contain-32,767 characters
Characters in a header or footer-255
Sheets in a workbook-Limited by available memory (default is 3 sheets)

Downloading and Formatting Web Data with Excel VBA

I need help creating a VBA macro that downloads closing price data directly from Yahoo Finance's Historic Quotes website and imports the data into an Excel spreadsheet column.
Background information:
This is the link to Yahoo Finance's Historical Quote database -
To download as a TXT file:
http://ichart.finance.yahoo.com/table.txt?s="StockTicker"&d="EndingMonth"&e="EndingDay"&f="EndingYear"&g=d&a="EndingMonth"&b="EndingDay"&c="EndingYear"&ignore=.txt
Formatting Issue:
By default, i.e. using Excel's Web Data Import Wizard, Excel imports the entire table which includes more columns than needed. I am trying to isolate the "close" column. I created a macro that formats the table to isolate the "close" column, but this macro requires me to manually download the data from Yahoo Finance as a txt file:
Sub Test_DownloadTextFile()
Dim text As String
'The variables for this URL (in light blue) should be retrieved from the spreadsheet, i.e. "StockTicker" will reference a cell with the ticker symbol "AAPL" in it and that will appear in the URL'
text = DownloadTextFile("http://ichart.finance.yahoo.com/table.txt?s="StockTicker"&d="EndingMonth"&e="EndingDay"&f="EndingYear"&g=d&a="EndingMonth"&b="EndingDay"&c="EndingYear"&ignore=.txt")
'At this point I should have the historical quotes table stored in the variable text. How do I select the 4th column and import it into a specific spreadsheet column?'
Debug.Print text
End Sub
How can I create a macro that:
1. Refers to the spreadsheet for key variables, e.g. "StockTicker", "EndingMonth", etc..
2. Downloads the corresponding historic data from Yahoo Finance
3. Imports the data closing price data as a single column into the spreadsheet
I would very much appreciate a practical solution to this problem. Let me know if I need clarify my question or the task at hand. Thank you!
Suggestion: this seems to be the perfect case for a Web Query.
Do you have any reason not to use that ? You can copy just the columns you need afterwards.
You did not specify you Excel version, but on 2003 it's on Data/Import External data.
Check out this SO discussion. Several suggestions that seem worthwhile.