c# - Zipping multiple excel files -
i need multiple excel files (ssrs reports), put them in folder , zip it. how tried, it's not working:
public actionresult pricingreports( list<int> productids ) { memorystream memstream = new memorystream(); using ( ziparchive archive = new ziparchive( memstream, ziparchivemode.update ) ) { foreach ( int id in productids ) { //preparing single excel file reportmodel model = preparereportmodel( values ); _ssrs.getreport( model, "excel" ); ziparchiveentry singlereport = archive.createentry( "pricingreport" + " - " + id ); using ( binarywriter binwriter = new binarywriter( singlereport.open() ) ) { binwriter.write( model.reportbits ); } } } return file( memstream.toarray(), system.net.mime.mediatypenames.application.octet, "pricing reports" ); }
Comments
Post a Comment