(
SELECT ', ' + Supplier_ID
FROM SomeTable
join SomeOtherTable
on Something
WHERE SomeCondition
FOR XML PATH('')), 1, 1, '') as AllSuppliers
A normal programmer, with normal problems, sometimes stupid, other times interesting. Just thought of giving something back to the community. All comments welcomed
Posted by
Radu
at
12:26 PM
0
comments
Labels: SQL Server 2005
Today our tester found a big saying "Incorrect numbering of the tables in the PDF export".
The issue is that we have a custom code function incrementing a number and than returning the resulting number. It starts from 0 and it'll return 1 first time it is called, 2 afterwards, 3 and so on. It works fine when my report renders in HTML, but not when it renders as PDF. The first table is numbered with 5 and the rest are numbered in order 1 to 4
The only difference between the first table and the rest is that the first table displays the table number in a row, while for the rest I had to add a text box above the table.
Apparently, the execution order of custom code is different when report is rendered in browser vs when it renders as PDF. I did a simple test by creating a test report, with just a matrix, a table and a text box and the textbox is indeed rendered first (it executes the custom code first). Only after, the tablixes are rendered
Posted by
Radu
at
5:42 AM
0
comments
I got a "nice" error today , while working on a report converted from SSRS 2005 to SSRS 2008.
<TablixCornerCell></TablixCornerCell> into the <TablixCornerRow>
Posted by
Radu
at
10:04 AM
2
comments
Today, for the second time since we started using SSRS 2008 I had the following stupid error:
Running a dataset works from VS designed, but when I try to run the report (again, from the VS2008 designer) I get errors (DS couldn't be run)
After little investigation I realize that the problem is in fact that the report cannot be built. I had VS2008 access to RDS file denied. this is not a read-only file, is checked-out, so VS should be able to access the file and change it.
However, VS keeps telling that access to {MyReportsFolder}\bin\Debug\{MyDataSource.rds} is denied
The only way I found to fix this was to delete the folder {MyReportsFolder}\bin and rebuild.
Weird...
Posted by
Radu
at
7:22 AM
0
comments
Yesterday I had to put some code into SSIS packages.
Being a lazy person, what I usually do is copying one of the existing task ("Execute SQL Task") and changing the name and the code itself. Apparently after installing VS2005 SP1 this was not working anymore.
I had to create every "Execute SQL Task", set the connection, etc....which is not a lot but is slower than what I was used to.
The error message I was receiving while trying to copy was "An error occurred while objects were being copied. SSIS Designer could not serialize the SSIS runtime objects". A fast google search revealed this page and the easy fix by jaegd:
Register the xml parser dlls with the below commands.
regsvr32.exe msxml3.dll
regsvr32.exe msxml6.dll
It really worked and fixed my problem, but lets me wondering why Microsoft didn't fix it and release a SP2 with all this fixes.
Posted by
Radu
at
1:10 AM
0
comments
Labels: SSIS, VisualStudio
Posted by
Radu
at
9:51 AM
0
comments
Labels: SQL Server 2005, string
Posted by
Radu
at
2:03 AM
2
comments
Well, that's what happen when you don't carefully read the documentation. I have recently discovered the benefit of the WITH ROLLUP clause in SQLServer 2005, and I thought what it was doing was returning all possible combinations of grouping.
Wrong, that's the WITH CUBE.
Using the WITH ROLLUP I found out that the number of rows returned by my query was dependent on the order of the fields in the group by clause. Funny.
Well, to keep it short, I found this: http://msdn.microsoft.com/en-us/library/ms189305%28SQL.90%29.aspx
because "ROLLUP generates a result set that shows aggregates for a hierarchy of values in the selected columns" we get results depending on this hierarchy.
unlike it, what I needed was the WITH CUBE clause: CUBE generates a result set that shows aggregates for all combinations of values in the selected columns.
Posted by
Radu
at
8:04 AM
0
comments
Labels: cube, rollup, SQL Server 2005
Posted by
Radu
at
12:57 PM
0
comments
Labels: report, VisualStudio
While working on a web site recently, I used Visual Studio 2008 for a small wizard in ASP.NET.
It was cool at the beginning, but it become really painful when, after a while, I was trying to update the tables on the page. Seems like Visual Studio is creating a lot of stupid style-sheets when you drag the table's rows or columns. Hilarious things, like very height rows of the tables, happen. When you try to resize the row back to it's normal size, no way. The only way I found was to manually edit the ASPX and delete the generated styles. And I'm not the only one having problems with it, a friend whom I am working with reported the same problem.
While I like Visual Studio for it's ease of use and clean interface, I found the way it deals with the wizard to be very...let's say at least uninspired. So, what can be done ?
1) Integrate really often, so if the things get messed up you can come back to a good version.
2) Manually edit the ASPX for small changes. It's much faster than trying to convince VS to work the way you'd expect.
Posted by
Radu
at
10:32 AM
0
comments
Labels: ASP.NET, VisualStudio