VB Code in SSRS Report

Is there a better way to edit the custom VB code in a SSRS report, than just selecting the Report properties, and going to the code sheet?

image

There’s no editor functionality (auto indent, block indent, find/replace, etc…), no syntax highlighting, no intellisense, etc… It doesn’t even have line numbers. So when there is an error, and the error includes the line number, you have to manually count. And the Properties dialog window always launches the same size. I have the expand the dialog window to make the editing area useful.

I’ve Started just entering code in Notepad2 (It has VB syntax highlighting and what not). Then copy and paste into the custom code field in MS Report Builder. But if I se one little thing that needs tweaking, I have to go back into Notepad2 and tweak it there, then copy and paste it back into Report builder. Else my two sets of code start to diverge.

You can make a project in VS in edit the rdl there. There are definite advantages to editing in Visual Studio, but I’m usually too lazy to make the project and just do it in Report Builder and edit some things NotePad++.
I like using the macros in NotePad++ to make the query text readable.

2 Likes

Iv’e just recently got VS up and running. Boy was it hard to get SQL Express, SSMS and Report Builder installed.

Not really the installation process itself, but rather having to do them outside of VS’s installer.

VS Code works too. RDLs are just XML files.

3 Likes

VS Code is my go to. Better than Notepad++ without all the hassle of full Visual Studio.

Make sure to save the code you’re working on with the right file extension (.vb, .cs, .sql, etc.) and all the formatting happens automatically.

1 Like

It’s because the GUI editor seems much of an after thought, as others have pointed out, and you have probably already discovered, way too much “programming” effort is needed for even things that on other platforms might seem trivial - but I digress - the juice is in VS.