How do you print and export when using Dundas charts in VB or C# - vb.net

I'm using Dundas Chart Profession within my VB program to generate a chart based on my data. Right now I have my charts opening fine but I am unsure how to add the functionality to let the user choose to print (and export) the chart once the program is running.

I didn't figure out how to export the chart but I have figured out how to print and save it.
To print:
To print the chart I found the solution here. This is on the Dundas Data Visualization Components Support page labeled under "Customizing the size of printed chart". Also in case you are wondering how they got the PrintDocument, like me, it is located under System.Drawing.Printing.PrintDocument.
To save:
To save all you have to have is
ChartName.SaveAsImage("pathwayAndFileName.png", ChartImageFormat.Png)
Where ChartImageFormat is under Dundas.Charting.WinControl and png can be any extension under Dundas.Charting.WinControl.ChartImageFormat. Of course this ran into having to know the filename and pathway that the user wants to use so I researched how to do the dialog for saving, built in, as I didn't want to recreate it myself. I found the SaveFiledialog under System.Windows.Forms where they also have open, load, and print. Of course I already had the other print.
To set the initial directory it uses is
dialogName.InitialDirectory = Application.StartupPath
Then open it with ShowDialog

Related

How to save data from javafx form to pdf?

I am trying to implement a functionality such that:
When a user clicks on save button, whole data fetched from database by javafx (scene builder)form to get stored into the pdf form.
I have done with the snapshot, but I want the data obtained via text form to be stored in in pdf file.
Can someone please help me ?
give "DynamicReports" a try, it's easy to use, and i am using it to generate PDF file in my javafx projects. simple and powerfull.
http://www.dynamicreports.org/
Not only PDF file, it can also help to generates Csv, Docs, Excel, Html, Odt, Pptx, Rtx, Text...
You have a snapshot of your scene.
You can use the JavaFX Printing API, with PrinterJob.
The trick is that when your print anything, your computer's own print spooler will ask you for a destination.
My computer offers "Microsoft Print to PDF" and "Save to PDF".
So the "PDF" feature is trivially easy. All you have to do is, figure out how to use the API.

Print preview of my web page to pdf and save it on server side programmatically

I have a deceitfully difficult problem which I had thought it was easy one at the beginning and yet I have spent more than 3 days on and off in total.
what I simply need to do is to save the print preview of the page to PDF file on server side from code behind initiating by a button click.
I was expecting using an open source and then I thought there would be a code like xyzopencode.savepasgeaspdf(path) but I could not find it. I got really close to solution by saving the PDF but then I realized it did not save the picture it only saved the strings.
I tried the pdfsharp but as long as I see it draws the whole thing from scratch and I am nor sure if I can do it.
The reason I need picture compatible one is I have 3rd party signature controller on my page and my couple of attempts worked without them or any picture but when I added pictures they failed to show to picture or did not create the PDF at all. The perfect solution would be just saving what ever shows up in the print preview as PDF, just like the built in feature of Google chrome (but on server side).

Placing a bitmap into a Powerpoint Add-In

All:
I am writing a PowerPoint add-in that will allow a user to drop specific safety related images onto a map. I've written the code that copies the images and places them on the slide and I would like to place it into an add-in. Unfortunately, I cannot find a way to either:
a) place the images into the add-in
b) reference images if I were able to place them in the add-in
The alternative approach is to require the user to start with a special template that includes all of the images and then load the add-in to get the menu functionality. I would much rather have a single file that contains both the code and bitmap images.
With best regards,
Walt
PPA files contain only code, not presentation content like images. As an alternative, you could distribute a PPT/PPTX that you open invisibly and extract the image you need.
After quite a bit of looking around I found a solution that resolves the problem adequately. Using Microsoft's Custom UI Editor, I created an XML entry in the PowerPoint Presentation that performs the Auto_Open function that would have been part of the Add-In. This allows me to add the menu functions that will be responsible for loading the specific images.
I've added a reference page at the beginning of the presentation that contains instructions on how to use the template... This page also contains all of the images that are used by the visual basic code. The 'Visible' flag on these images are set to False so the user does not see them. As they are copied from the reference page into the presentation, the Visible flag is set to True and they are pasted onto the current slide.
It is not a perfect solution, but it is adequate...

How can I export the contents of a data bound datagridview to word in vb.net?

I have found ways to do this in c# or asp.net, but I need VB.net. I have a dataviewgrid that I need to export to a .doc file (i am sure I can figure out the formatting and such of the doc). Or, if that is too complex, to an excel file.
There seems to be many asp.net examples, but nothing that works in vb studio on vb.
In the past displayed the datagridview on screen and changed the mime type of the page to application/excel. It will automatically open in an embedded excel file.
Try this link for how to do it: http://support.microsoft.com/kb/317719

How to export Gantt view to pdf?

I am using openerp 6.1 and I have created a project in which I have my phases and tasks in each phase.
I would like to print the gantt chart but there is no option there. Please advice how I can get this done.
Their is default way out to have it on PDf but what you can always do is prepare one report to plot that report on pdf like Burn-down chart you have on project_scrum module, Using Pychart and reportlib engine, and you can produce effective result, or you can take moden web browser screen shot utility at the end.
Thank You
I agree, there really should be print / PDF buttons for every page to save the current view :(
There are 2 workaround options I can think of:
Use reporting to generate your own report of the chart (I would suggest using the webkit_report)
Print the HTML view to PDF.. ie, capture the html code of the view and print it, or send to another system to convert to PDF (using wkhtmltopdf). I have an example here that might help you: http://timothysolomon.co.za/work/openerp-printing-with-javascript/
Good luck, maybe in version 7 they will have this by default.