SSRS 2005: How do I make available varbinary data for download in a report? - sql-server-2005

SSRS newbie question here...
I have a table where one column is varbinary(max) data. I would like to make a report that makes this data available for download as a hyperlink so the user can just click on the item and get a file download dialog for the binary data. In this particular case, the binary data happens to be the content of old pdf files, but that shouldn't matter.
I tried searching around but I can't find any pointers on how to do this. It seems to me that it should be possible. There are ways to display images in a report using varbinary data, so it makes sense that one should be able to make arbitrary binary data downloadable on a report, right?

No, it is not possible as far as I can tell. Don't see anyway to do this.
The work-around that I used was to create a simple asp.net page to serve the binary content through some URL. I then hyperlinked to that page from the SSRS report giving the right variables in the URL. Works fine for me, YMMV if you have to worry about URL hacking or security issues.

Related

Somehow send command line commands on windows externally and get back the response

Problem: Need to convert local html (with local images etc) to pdf from an AIX box running Universe 11.2.5 with System Builder
Current solution: FTP over html file to a Windows server which converts in batches and sends the e-mail to the destination
Proposed Solution: Do everything on the AIX box, from converting html to pdf and sending the e-mail.
Current problem: Unable to find a way to convert local html to PDF on the AIX box. I have been trying many different ways from trying to install Python3, but to no avail.
The only really difficult part of the process is getting the HTML to render into a format will properly display your html into pages that are suitable for printing. There is a fair amount of magic that goes on between HTTP:GET and clicking print on a browser window that needs to be accounted for.
I was trying accomplish something similar many moons ago on AIX but kind of ran into a skill level/time wall because I was going to have essentially create a headless browser to render the html. It looks like there are now some utilities that you might be able to leverage. I found this recent updated article on Super User that actually got me somewhat excited, especially since I don't use AIX anymore so precompiled binaries and well understood and easily attainable dependencies are something I can actually have in my life.
https://superuser.com/questions/280552/how-can-i-render-a-website-as-an-image-from-the-shell
Good Luck.
There seems to be several questions rolled into this one item.
Converting HTML to PDF, while that is just a data manipulation that you could do in basic, writing such code would be a large task. The option you use sending it to another system is valid, but put more points of failure into the system. I would think you could find code to do it on the AIX box.
Rocket plans on getting the MV Python to work on AIX, this will make the converting of html to PDF much easier since there are a lot of open source modules.
As for my suggestion of using sockets, that would be if you intend to send it to a service that will take the htms, and return the pdf document.
i.e. Is there a web service for converting HTML to PDF?
Once you have the pdf document, you can either store it in a UniVerse type-19 file, or do the base64 encoding and store it in UniVerse hash file.
Hope this helps,
Mike

How can I extract the title of a pdf when downloading them?

I deal with pdfs a lot but when I try to download them it usually doesn't contain the actual title of the pdf/paper so I'll have to rename it most of the times, which I find is annoying.
In many cases URL doesn't have the title of the pdf, so I guess this has to be extracted by processing the content of the pdf. And it needs to be done on the client side, i.e., for e.g., as a browser plugin?
Is there a way that I can get the title when I'm downloading pdfs over the web via scripting or someting?
That most likely won't work and here is why.
You would have to write some incredibly dynamic code to fetch some sort of title for the PDF. You would have to have code that would scan a website, somehow pick out a title, then fire off a request to code running on your computer to change the name.
It would be somewhat inconvenient because you would always have to have the script run on your computer (likely always having terminal open).
Your code would be highly prone to error. If your website script messed up, you could accidentally name the PDF incorrectly and then not be able to find it based on how inaccurate the name is.
For now, I would suggest dealing with the pain of editing the PDF name manually.

SQL Server Reporting Studio report showing "ERROR#" or invalid data type error

I struggled with this issue for too long before finally tracking down how to avoid/fix it. It seems like something that should be on StackOverflow for the benefit of others.
I had an SSRS report where the query worked fine and displayed the string results I expected. However, when I tried to add that field to the report, it kept showing "ERROR#". I was eventually able to find a little bit more info:
The Value expression used in [textbox] returned a data type that is
not valid.
But, I knew my data was valid.
Found the answer here.
Basically, it's a problem with caching and you need to delete the ".data" file that is created in the same directory as your report. Some also suggested copying the query/report to a new report, but that appears to be the hard way to achieve the same thing. I deleted the .data file for the report I was having trouble with and it immediately started working as-expected.
After you preview the report, click the refresh button on the report and it will pull the data again creating an updated rdl.data file.
Another solution to this issue is to click Refresh Fields in the Dataset Properties menu.
This will update the list of fields, and force SSRS to get new data, rather than relying on a cached version.

vb.net using a custom file to save different types of data

I'm brushing up on my VB.NET skills for a future project I will be working on. This application will be very data intensive, requiring 20+ data tables, user supplied images, and possibly even short audio/video files.
I want to be able to save all of this information into a single, external file, so that the user can share what they create with the world.
Ideally, I would like all the text based data to be stored in a database format that I can easily work with, preferably via the entity framework.
Pretty much all the information I'm finding relates to only saving a single text/XML file, and that will not really work for me. Can anyone point me in the proper direction, or suggest a method that will let me save the data?
I'm working inside Visual Studio 2012 Pro, with a Visual Basic Windows Form Application. Please let me know if you need any additional information.
I'll expand my comment to an answer instead.
As previously mentioned this sounds like a zip file. In this you can:
Have a file called databasetables.txt or whatever containing the database tables.
You can have Audio, Video, Images etc in respective folders. This way when you open your file you can just load all files in the Audio folder to get the expected files.
You can have information stored in xmlfiles.
Endless posibilities...
Just keep in mind that you might want to load all this only into the memory of the computer so you dont extract it onto the hard drive.
And you dont have to save the file as .zip to open it as .zip, just select your own cool suffix which will look neat :)

Automating site interaction

I'm working with a CMS and need to import data to it using typical html forms. The data itself is in csv files with one page per row. Such is the CMS that importing directly to db isn't possible due to the complexity of the design. It's pretty important that i "fake" usual user interaction because the CMS does a lot of background work that's crucial for the import.
Basically, for each row in the csv file, I need to copy a csv column to a html textfield, or select a checkbox, or click a certain button. One major issue is mapping the data in the csv to actions in the CMS. So if one column contains the string 'foobar' is really means "set the firstName dropdown widget to 'foobar'".
Is there a tool to automate this? I´ve been looking at AutoHotKey, Selendium, Web-Harvester and many other tools but I'm not convinced they are the correct tools. The main problem is being able to interact with the html pages in a easy way.
There are a bunch of tools that do that. Visual Studio Team Test Edition will do this by recording your actions and allow you to modify the resulting C# programming. You can then read from your CSV and replay in a loop.
You can also do this relatively easily if your interface doesn't change much using HTML Agility Pack.
Also I've written regular C# ( HttpWebRequest and Regex ) programs to do this and it's not very difficult either.