Question

I followed this articel store fast report template , to implement it but I cant save and load the report because the stream is empty !!!

Was it helpful?

Solution

Finally I figure out the problem , it is related to the SQLSERVER real available space to store in DB for varbinary field as my FASTREPORT template size was byte[616054] so it just save 50 byte in sql , check this link varbinarymax, So , I changed the data type to the ntext and convert stream to string for storing and do the reverse for retrieve mechanism

this command byte to string

 byte[] blob = stream.ToArray();
  string st=  System.Text.Encoding.UTF8.GetString(blob);

and this one for retrieve

byte blob2 =Encoding.UTF8.GetBytes(this.TableAdapter.GetDataByID(key).Rows[0]["Report"].ToString());

also can try this one to use varbinary(max) check it out : Enable File Stream in SQL

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top