SSRS Data Driven Subscription that customizes DeviceInfo settings like PageWidth, PageHeight? - sql-server

I want to set up data driven subscriptions to mass output png files. The problem is that adding a new Extension for png in rsreportserver.config under Configurations/Extensions/Render only gives one fixed size of png file.
Report A really ought to output a 6in x 3in png file and report B ought to output a 6in x 4in png file.
Yes, I could create multiple entries in rsreportserver.config but this is confusing for end users as they show up on all users' export dropdowns needlessly.
I proposed doing the mass image generation with an external program that generates a custom url for each png (DeviceInfo settings can be part of the url) and uses WebClient.DownloadFile() in a loop, but my supervisor is currently really locked into the idea of data driven subscriptions for whatever reason.

Per #iamdave's suggestion, just setting the overarching page dimensions in report designer does give a suitably sized png file via data driven subscription without having to hardcode png dimensions in rsreportserver.config.
The reason I didn't initially notice this was the reports in question were graphs that were only ever used as subreports on an encompassing megareport and had never really been run as individual standalone reports. When used as a subreport, page dimensions never came into play, so they were left at the default 8.5x11.

Related

Render part of page to file

How can I make InDesign render a region of a page, as it would be rendered when exporting the whole file?
I know I can render a PageItem using the exportFile function, but this will ignore any other PageItems sharing the same region.
My current solution is to make a new document the size of the region of interest, with a copy of each PageItem whose coordinates fall into that region. It’s very inelegant, and it seems it cannot be done without the user seeing windows meaningless to them come and go.
Another approach I can think of is to export the whole spread containing the region, then crop the resulting file using something like ImageMagick. But I’d still prefer to be able to render only the region I need, if possible.
You can open the InDesing document without showing its UI as well.
app.open(filepath, false);
and while closing the doc, simple use
doc.close(SaveOptions.NO);
You anyways don't need to save that doc on disk.
This will let you have the document open without showing its UI at all.
I did something like this recently. Here are my steps:
duplicate all spread items and group them
make a frame with a proper size/position
cut and paste the group into this frame
export the frame as PNG
If you need another region on this spread you don't need to repeat all the steps, you can change size and position of the frame and to export it again.
There is a limitation: master page items will be omitted.

Setting SSRS BackgroundImage Source from field

I'm working on an SSRS template at present which pulls lots of its format information from a database. Part of this format information sets the Background Image of cells.
I'm currently filling the image by setting the Source to External and pulling its value from the database. This works lovely, however It means pulling the image from a network source each time and while a small efficiency hit, I'd like to try and remove that pull if possible by embedding the standard images.
Again this works fine, I can pull either an external image or an embedded image and display on screen. The problem comes when I'd like the option to do either.
I find that I cannot set the image Source from a field, there isn't an option in the GUI.
I've tried going into the code and entering the details there but I get a validation error:
The 'http://scemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition:Source' element is invalid - The value =First(Fields!bodyBackgroundImageSource.Value, "dsTemplate") is invalid according to its datatype String - The Enumeration constraint failed".
Has anyone else come across this and found a solution or know of a workaround? I can continue using only external images, but would prefer to avoid as many external calls as possible.
In our local environment, we tested this scenario and if the expression can return the correct image name, then the image can display properly. You can check if the "First(Fields!bodyBackgroundImageSource.Value, "dsTemplate")" expression return the image name existing under Images folder on Report Data window. And make sure the image source is embedded.

How can I access the iTunes DB in VB6?

I am trying to rewrite a closed-source program called Pod Player (written in VB6). To do anything, I need to be able to access the iPod's DB and load it into a series of ListBox controls. Things I need to access is: any playlists and what they contain, the iPod's name, track numbers, song titles, genres, artists, albums, path to the songs, their rating, UIN, file size, length and preferably album artwork. I also need to be able to change rating information if needed. So how can I interact (read/write) with the iPod's DB in VB6?
Or is it possible to write a DLL or OCX in another language that can do this and be called/used by the VB6 program?
I should also mention that Pod Player uses some or most of SharePod's code (before SP went .NET).
I found a database parser on Planet Source Code and tried out the demo form included as well as an implementation of it in my Pod Player rewrite, but (according to the demo form) it only reads 76% of the database before dropping out due to a playlist-related problem. I tested it on an iNano 4 and an iShuffle 4 and both are completely compatible with Pod Player. How can I get it (parser is in iPod.bas) to work correctly?
Have a look at this page: http://homepage.ntlworld.com/simon.mason20/ipod_tunes_spec.htm
It contains details of the iTunes database format

how to override image in media library in WP7

I want to save image to media library in windows phone 7. I`m using this example http://msdn.microsoft.com/en-us/library/ff769549(v=VS.92).aspx . It works fine, the only problem that i have is that after image modification i call save procedure with the same file name, exactly like in example
MediaLibrary library = new MediaLibrary();
Picture pic = library.SavePicture("SavedPicture.jpg", myFileStream);
myFileStream.Close();
but modification is saved to another file, even thought i use the same file name when i call SavePicture (and i want to override the image file). What am i doing wrong?
Reading between the lines a little you are seeing a new picture appear in the phone saved pictures collection where you were expecting an existing one to be replaced?
You should note that the code you have referenced creates duplicate pictures. One is stored in the phones saved pictures collection and another is saved in isolated storage for the application.
Its not possible for an application to mutate an existing picture in the saved pictures collection even if that application is the original creator of the picture. When saved, a new picture is created in the saved pictures collection.
On the other hand the existing content of the file in the isolated storage is replaced with the new content.
You can't.
It's only possible to read and add images in/to the MediaLibrary.
It is not possible to edit or delete images.
This is by design.

Getting a CGImage out of a PDF file

I have a PDF file where every page is a (LZW) TIFF file. I know this because I created it. I want to be able to load it and save it as a bunch of TIFF files.
I can open the PDF file with CGPDFDocumentCreateWithURL, and get a page. I can even draw the page onto the screen.
What I WANT to do is draw the page into a bitmapContext, so that I can use CGBitmapContextCreateImage to get the image into a CGImageRef. However, in order to create a bitmap context, I need to know the size and resolution of the image. I can't seem to find out how to get either a CGPDFDocument or a CGPDFPage to tell me the resolution of the image object on that page.
Is there an easier way to do this that I'm not realizing?
thanks.
Ghostscript will work for you here :
gs -sDEVICE=tiff32nc -sOutputFile=foo-Page%d.tif foo.pdf
For 2 page document foo.pdf you should get :
foo-Page1.tif
foo-Page2.tif
From memory I think the output resolution from GS is that of the containing Page, not necessarily the resolution of the embedded file (unless these are the same to begin with).
If this is the case and you want to recover the image as it was originally res-wise, you can use iText (java) or iTextSharp(.net) to get to the image content stream (ie. Bytes) and write them out to disk in the format of your choice, after converting the content stream into a PdfImage iirc.
Hope the ghostscript option is applicable to save writing yet another utility...

Resources