문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top