Logic to handle when a RO Database is selected when generating report information

In creating a temporary (meta) file for Complete RO Report, file was sometimes not created anew with the FileMode.Create setting.  Changed to FileMode.Append and specifically delete the meta file before calling to generate it.
This commit is contained in:
John Jenko 2015-01-27 19:39:31 +00:00
parent 9c62cc93eb
commit b9c6d317c7
2 changed files with 8 additions and 3 deletions

View File

@ -1631,11 +1631,14 @@ namespace RODBInterface
public VlnXmlElement RODB_ReadRO(string tbl, string recid)
{
VlnXmlElement retele = null;
string readstr = "SELECT ParentID, AccPageID, Info FROM " + tbl + " WHERE RecID = '" + recid + "'";
string readstr = "SELECT ParentID, AccPageID, Info FROM " + tbl + " WHERE "+ ((recid==null)? "ParentID = '00000000'" : ("RecID = '" + recid + "'"));
try
{
DBE.Command(readstr);
DBE.Reader();
if (recid == null)
DBE.Read(); // skip the first parentID record of 00000000
if (DBE.Read())
{

View File

@ -123,12 +123,14 @@ namespace RODBInterface
{
try
{
Rptfs = new FileStream("print.tmp", FileMode.Create);
//Rptfs = new FileStream("print.tmp", FileMode.Create);
Rptfs = new FileStream("print.tmp", FileMode.Append);
// Create the writer for data.
RptBW = new BinaryWriter(Rptfs);
}
catch (Exception )
catch (Exception ex)
{
Console.WriteLine("Open Print.Tmp: {0}", ex.Message);
return false;
}
return true;