update: some background - I am using an XML file to create a set of PDF files (via a java application that runs JasperReports). all reports are blank when I use this new XML file. I ruled out problems with the network because I am using the old xml file from the same server as I am running the java application with the new XML file. I matched two files (old-good and new-bad) using a hex editor, and my first key is that there are carriage returns in the new file, and not one in the old one. this may not solve the problem, but I would like to exclude it from the equation.
It seems to me that I need to remove all carriages from my xml file so that it works the way I need it. In my travels, the closest I found is the following:
.Replace("\r","")
but where to use it in the following code? I create my data model, create a root directory and pass it to the serializer. At what point can I say "delete carriage return?"
let def = new reportDefinition("decileRank", "jasper", new template("\\\\server\\location\\filename.jrxml", "jrxml"))
let header = new reportDefinitions([| def |])
let root = reportGenerator(header, new dbConnection(), new reports(reportsArray))
let path = sprintf "C:\\JasperRpt\\parameter_files\\%s\\%d\\%s\\%s\\" report year pmFirm pmName
Directory.CreateDirectory(path) |> ignore
let filename = sprintf "%s%s" path month
printfn "%s" filename
use fs = new FileStream(filename, FileMode.Create)
let xmlSerializer = XmlSerializer(typeof<reportGenerator>)
xmlSerializer.Serialize(fs,root)
fs.Close()
source
share