|
With respect. If SAP created a calculator product that only worked with single digits would you suggest there is some thing wrong with the number 11.
SAP Crystal Reports creates usable HTML if the RPT file does not underline text or contains tables.
I am asking if anyone has experience taking a Crystal RPT and saving the output as html.
|
|
|
|
|
PhilMcGahan wrote: you suggest there is some thing wrong with the number 11.
Your original post did not suggest that it did not work. All you said was "is poorly formatted"
You might want to do the following
1. Explain in detail what the exact problem is.
2. Provide an small example that demonstrates the problem.
3. If you post code to this site then use code tags.
PhilMcGahan wrote: I am asking if anyone has experience taking a Crystal RPT and saving the output as html.
Googling suggests many people have.
Far as I can recall I only used it for Word and CSV. The Word output was fairly complex. It did require work arounds. But I did that 20 years ago. And the work around was due to memory constraints.
|
|
|
|
|
Solution:
To get perfect HTML out of Crystal Reports, out put your report to PDF, then use nuget package SautinSoft.pdfFocus to convert the pdf to HTML. I have tried many ways, this way works.
Public Shared Function ConvertPDftoHtml(pdfFile As String) As String
Dim htmlFileOut As String = pdfFile.ToLower().Replace(".pdf", ".html")
If File.Exists(htmlFileOut) Then
File.Delete(htmlFileOut)
End If
Try
Dim f As PdfFocus = New SautinSoft.PdfFocus()
f.OpenPdf(pdfFile)
If f.PageCount > 0 Then
Dim iResult As Int32 = f.ToHtml(htmlFileOut)
End If
f = Nothing
Catch ex As Exception
File.WriteAllText(htmlFileOut, $"ConvertPDftoHtml() Reports: {ex.ToString}")
End Try
Return htmlFileOut
|
|
|
|
|
I'm glad you were able to figure out a solution.
Just as an aside, that looks like VB, not C#. You posted in the wrong forum.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
NB: That is a commercial product, starting at $599 per developer.
Given the eight year break in messages, and the recent flurry of very similar messages, I'm starting to suspect your account has been taken over by a spammer.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
The code below will load an rdl report from a datasource and save it as PDF. But only PDF.
If I choose any other format it errors with
System.ArgumentOutOfRangeException
HResult=0x80131502
Message=Specified argument was out of the range of valid values.
Parameter name: format
Source=Microsoft.ReportViewer.WebForms
...
at Microsoft.Reporting.WebForms.Report.Render(String format, String deviceInfo, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]&
--- I would welcome a suggestion. Code as follows
Private Sub SaveReportAsHtml(rdcFile As String, outputfolderRoot As String)
'rdcFile = = "Report001ByPhil"
'outputfolderRoot = = "C:\temp"
Dim localReport As New LocalReport()
localReport.ReportPath = rdcFile
Dim ds As DataSet = FillADataSetWithSampleData()
Dim reportDataSource As New ReportDataSource("DataSet1", ds.Tables("table1"))
localReport.DataSources.Add(reportDataSource)
Dim mimeType As String
Dim encoding As String
Dim extension As String
Dim streamIds() As String
Dim warnings() As Microsoft.Reporting.WebForms.Warning
Dim outputFormat As String = "MHTML" 'does not work
outputFormat = "HTML3.2" 'does not work
outputFormat = "HTML4.0" 'does not work
outputFormat = "HTMLOWC" 'does not work
outputFormat = "PDF" 'works
Dim bytes As Byte() = localReport.Render(outputFormat, Nothing, mimeType, encoding, extension, streamIds, warnings)
Dim outputPath As String = Path.Combine(outputfolderRoot, "SSRS_output")
outputPath = outputPath + "." + outputFormat
DeleteFile(outputPath)
Using fs As New FileStream(outputPath, FileMode.Create)
fs.Write(bytes, 0, bytes.Length)
End Using
End Sub
|
|
|
|
|
Google
visual basic "LocalReport" render "Specified argument was out of the range of valid values."
From that and this very site
https://www.codeproject.com/Questions/1130614/How-to-render-localreport-to-HTML-using-csharp
It says you can't do what you are attempting. I did not verify the answer.
|
|
|
|
|
Thank you that was very helpful.
|
|
|
|
|
Supported formats include Excel, PDF, Word, and Image.
Note that this specifically does not mention HTML in any form.
You can use the LocalReport.ListRenderingExtensions method[^] to get the list of supported formats.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you. That was very helpful.
|
|
|
|
|
Morning everyone,
less a question but more a discussion.
I am tasked to create a Blazor page we will use to track our RSS or Atom Feeds of interest, which we check regularly and validate if anything related to our work is posted.
I was thinking about displaying the feed contents as markup string, so you'll also be able to read the article directly within the app instead of navigating to the website.
The feed will only be displayed, the data to be stored is detached from the display and will only track if someone of the team has read and validated that article. But i am a bit unsure if that would be a good apprach, with markdown for the display the app would be vulnerable for XSS, but on the other hand if the feed was malicious and the collegue naviagates to the article the XSS could trigger on the corresponding page then.
Am i a bit too cautious on that topic or would you as well only provide a link to the article? I feel it would be neat if you could read the article directly in that app but i am afraid it may cause a security issue.
As a side note i also must admit that we are ordered to limit our usage of 3rd party libs, which would probably help on sanitising the feed contents, although, as written above there is always the option to navigate to the article which just "outsources" the problem.
Thanks for your answers in advance.
Rules for the FOSW ![ ^]
MessageBox.Show(!string.IsNullOrWhiteSpace(_signature)
? $"This is my signature:{Environment.NewLine}{_signature}": "404-Signature not found");
|
|
|
|
|
Hello Beautiful People,
I do photography as a hobby and also play games. As such, I often use SDR mode for the desktop / photography side, but want to swap to HDR mode for playing some games.
Being a bit forgetful, I’ll launch a game from Steam/GOG only realise that I forgot use Win + Alt + B to toggle HDR. Now I have to sit through all the opening movies before I can exit the game, manually turn on HDR then relaunch.
I’d like to develop my own launcher that will allow me to toggle HDR mode prior to calling Steam/GOG to launch a game.
Does anyone know if toggling HDR mode is possible in C# please?
Thanks for your time,
MrCrane.
|
|
|
|
|
There is an MS API which might let you do it: XDisplayTryEnableHdrMode - Microsoft Game Development Kit | Microsoft Learn[^] but you'd have to work out the DLLImport signature for yourself - I've never wanted to use it!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hello OriginalGriff,
Thank you for taking the time to reply.
Best regards,
MC
|
|
|
|
|
For something completely different. You could try to create a shortcut or batch file to run an Autohotkey script to change the setting then start the game.
GOG games should be easy, and you might be able to run the steam games from the desktop shortcut steam can create.
Just a thought.
Ron
Jack of all trades, master of none, though often times better than master of one.
|
|
|
|
|
I have an internal nuget. It pulls in the nuget for NSB 7.5.
The dependency info clearly shows it is pulling in 7.5.
However, when I then pull my internal nuget into a project, it attempts to put NSB 8.0 as the transient NSB dependency for the internal nuget.
I do not at all understand why this is happening or how to fix it. Has NSB messed up their nugets? What am I missing? Help. Please.
|
|
|
|
|
Why have you posted this in the C# forum? It clearly has nothing to do with writing C# code.
|
|
|
|
|
Well, you're very right. But also, very wrong.
|
|
|
|
|
Well that does not explain anything. If you want people to help you then you need to give proper details of your problem. And I still cannot see anything relevant to C# in your question.
|
|
|
|
|
Nevermind, I'll ask stack overflow. They're nicer about these things.
Seriously, this is the first thing I think I've ever asked here. Maybe .NET would be better, but I think if there are people who would have this answer they more likely to poke here.
|
|
|
|
|
jochance wrote: Seriously, this is the first thing I think I've ever asked here. Well after the other 300 odd messages you should know what the process is.
|
|
|
|
|
Sorry, I do not care about or for your pedantry. I simply do not.
|
|
|
|
|
|
Is there a better forum to ask questions about VS projects?
I can seem some overlap with others (like Managed C++) but nothing that seems to be specific about VS Projects.
|
|
|
|
|
It could go in .NET Core but... It's just the case here is going to more likely get the right eyes.
It doesn't really matter now. Fixed. (another nsb nuget was the cause, it required higher, so it was forcing it to pull a higher version - that nsb nuget was only in the top-level, so wasn't seeing that happen pulling this same thing into others).
My biggest beef is just the absolute ham-fisted pedantry. But it isn't like I ask or answer questions much here nor is it exactly inspiring to do so in the future. Maybe that's the point? Imaginary internet point hoarding?
Maybe it's just been a long day. Will never much care for that kind of stuff though.
|
|
|
|