admin管理员组文章数量:1387427
Google Sheets Unable to Open XLS/XLSX in React Native App I am working on a React Native app that allows users to pick an Excel file (XLS/XLSX) and open it in Google Sheets using @react-native-documents/viewer. Steps to Reproduce 1️⃣ Install Dependencies npm install @react-native-documents/picker @react-native-documents/viewer 2️⃣ Create a React Native App with a File Picker and Viewer Below is my implementation:
import { viewDocument } from '@react-native-documents/viewer';
export const fileViewer = async (fileURI: string, title?: string): Promise<void> => {
try {
if (fileURI) {
console.log('fileURI:', fileURI);
await viewDocument({
uri: fileURI,
grantPermissions: 'read',
headerTitle: title,
presentationStyle: 'fullScreen', // iOS only
});
}
} catch (error) {
console.error('Error opening file:', error);
throw error;
}
};
File URI Example:
file:///data/user/0/com.xyz.abc/files/abc/_17624BDEF0BC42DA3B6551B1A4E9F2DE/_6DC3140B46DE1CC63C17A62D47391987/pdf/1074157.xls
本文标签: react nativegoogle sheets was unable to open your spreadsheetStack Overflow
版权声明:本文标题:react native - google sheets was unable to open your spreadsheet - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744570816a2613327.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论